Own-and-Ship / oas_agent

The Own & Ship Ruby agent
2 stars 0 forks source link

Run tests locally for ancient ruby versions #9

Closed wjessop closed 1 year ago

wjessop commented 1 year ago

Testing ye olde Ruby versions locally in Docker

This will allow testing of failures on older Ruby versions locally as long as Docker is installed. To test all versions this library supports you can run:

rake test:all

You will get an output something like this:

Ruby 2.3.8 ❌ failed, run this version using `rake "test:one[2.3.8]"`
Ruby 1.9.3 ❌ failed, run this version using `rake "test:one[1.9.3]"`
Ruby 2.2.10 ❌ failed, run this version using `rake "test:one[2.2.10]"`
Ruby 2.4.10 ❌ failed, run this version using `rake "test:one[2.4.10]"`
Ruby 3.0: ✅ passed
Ruby 3.1: ✅ passed
Ruby 2.7.5: ✅ passed
Ruby 3.2: ✅ passed
Ruby 3.3-rc: ✅ passed
Ruby 2.6: ✅ passed
Ruby 2.5.9: ✅ passed
Ruby 2.1.10 ❌ failed, run this version using `rake "test:one[2.1.10]"`
Ruby 2.0 ❌ failed, run this version using `rake "test:one[2.0]"`

Where a version fails you will be given a command to run the tests for that specific version:

rake "test:one[2.4.10]"
or…
VERSION=2.4.10 rake test:one

This will give you the test suite output too so you can see what failed. If you need to diagnose Docker/build issues then pass VERBOSE to get the docker build output:

VERBOSE=1 rake "test:one[2.4.10]"

If you need to further diagnose Docker build issues you can build a docker image for the version you're interested in directly:

docker build . --build-arg RUBY_VERSION=2.4.10