ontoportal / ontologies_linked_data

Models and serializers for OntoPortal objects and services backed by triple-store
Other
1 stars 18 forks source link

Unify how we run tests and the code locally #1

Open syphax-bouazzouni opened 1 year ago

syphax-bouazzouni commented 1 year ago

Currently to run tests , there is all this (historical) options:

I think we need to harmonize how we run tests, by (if possible):

That was for testing, but why can't we use the same docker-compose.yml for development ?

syphax-bouazzouni commented 1 year ago

@alexskr what do you think about this?

FYI @ontoportal/industryportal , @ontoportal/ecoportal, @ontoportal/bioportal

alexskr commented 1 year ago

I agree it would be a good idea to update and standardize the way we run unit tests.

Our current approach is to run bundle exec rake test inside a container (ruby) that connects to backend services running on other containers. This way developers do not need to worry about installing dependencies in their personal mac/pc/linux environments and simply rely on pre-configured containers. Unit tests run in a linux environment which is close to how we run stuff in production. More than once we run into platform-specific issues which made unit tests work differently on mac vs linux. It is also possible to simultaneously run tests from different projects without running into port conflicts.

Most of BioPortal developers use RubyMine which has a way to interact with containers but I do not think that we have fully switched development to use docker-based workflows yet.

One thing that can make it easier to use docker-based workflows is dip which stands for Docker Interaction Program. For example, to run unit tests I simply run dip test on my console which spins all necessary containers and runs unit tests. To install or update gems I run dip bundle update and dip spin up just the ruby container to install gems.

syphax-bouazzouni commented 1 year ago

Yeah, dip seams great to hominize our workflows. Can you (@alexskr) share with us your configuration files (your dip.yml on a pull request).

I think we will need at least those dip interactions:

syphax-bouazzouni commented 1 year ago

Yeah, dip seams great to hominize our workflows. Can you (@alexskr) share with us your configuration files (your dip.yml on a pull request).

I think we will need at least those dip interactions:

  • dip serve (run development server for the API project (docker compose up + bundle exec shutgun))
  • dip test (run current project tests)
  • dip update (run bundle update)

Ah sorry there was already shared 4 month ago, I didn't seen it. (still need a documentation and dip serve) https://github.com/ontoportal/ontologies_linked_data/blob/master/dip.yml