From: Andy Allan Date: Wed, 19 May 2021 10:02:41 +0000 (+0100) Subject: Switch to using 'rails test:all' in documentation and CI X-Git-Tag: live~1628^2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/4c785792fbfa8fc073b3a782875609426a49404a Switch to using 'rails test:all' in documentation and CI Fixes #3116. This allows us to drop our custom patch for running system tests, as well as opening up all the usual rails test goodies like running individual files or directories. --- diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4bf0f5f57..d718dcfa7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -33,4 +33,5 @@ jobs: curl -siL http://127.0.0.1:3000/api/0.6/node/1 | grep 'Null Island' - name: Test Complete Suite run: | - docker-compose run --rm web bundle exec rails test:db + docker-compose run --rm web bundle exec rails db:test:prepare + docker-compose run --rm web bundle exec rails test:all diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ee2a85862..174b6b0d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -66,7 +66,7 @@ jobs: - name: Install node modules run: bundle exec rake yarn:install - name: Run tests - run: bundle exec rake test:db + run: bundle exec rails test:all - name: Report completion to Coveralls uses: coverallsapp/github-action@v1.1.2 with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 568566c17..474c80b4f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ functionality. You can run the existing test suite with: ``` -bundle exec rake test +bundle exec rails test:all ``` You can view test coverage statistics by browsing the `coverage` directory. diff --git a/DOCKER.md b/DOCKER.md index ce0430939..1def8b1cb 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -56,7 +56,7 @@ Run the Rails database migrations: Run the test suite by running: - docker-compose run --rm web bundle exec rake test:db + docker-compose run --rm web bundle exec rails test:all ### Loading an OSM extract diff --git a/INSTALL.md b/INSTALL.md index c8811fc3f..bd6603eba 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -219,7 +219,7 @@ bundle exec rake db:migrate To ensure that everything is set up properly, you should now run: ``` -bundle exec rake test:db +bundle exec rails test:all ``` This test will take a few minutes, reporting tests run, assertions, and any errors. If you receive no errors, then your installation is successful. diff --git a/VAGRANT.md b/VAGRANT.md index ff4cb5737..ed84eed57 100644 --- a/VAGRANT.md +++ b/VAGRANT.md @@ -32,7 +32,7 @@ Within this login shell, you can do development, run the server or the tests. Fo ``` cd /srv/openstreetmap-website/ -rake test +bundle exec rails test:all ``` To access the web pages you run the following commands then access the site in your [local browser](http://localhost:3000): @@ -40,7 +40,7 @@ To access the web pages you run the following commands then access the site in y ``` vagrant ssh cd /srv/openstreetmap-website/ -rails server --binding=0.0.0.0 +bundle exec rails server --binding=0.0.0.0 ``` You edit the code on your computer using the code editor you are used to using, then through shared folders the code is updated on the VM instantly. diff --git a/config/locales/README b/config/locales/README index e8dc83288..136afb014 100644 --- a/config/locales/README +++ b/config/locales/README @@ -5,9 +5,9 @@ Do NOT edit any translations in here, please use translatewiki.net instead. The only file in this directory that should be edited by hand is en.yml, when localisation strings change or new translations are introduced. All other languages _need_ to be edited using translatewiki.net. Please make sure that you -run the tests using *rake test* to make sure that there are no errors, as there -is at least one test that makes sure that all translations are valid (we'll -makes sure that they won't cause the site to not work). +run the tests using *bundle exec rails test:all* to make sure that there are no +errors, as there is at least one test that makes sure that all translations are +valid (we'll makes sure that they won't cause the site to not work). There is more information about translating the website on the wiki at http://wiki.openstreetmap.org/wiki/Website_Internationalization. diff --git a/lib/tasks/testing.rake b/lib/tasks/testing.rake deleted file mode 100644 index 720530256..000000000 --- a/lib/tasks/testing.rake +++ /dev/null @@ -1,10 +0,0 @@ -task :test => :environment do - Rails::TestUnit::Runner.rake_run(["test/system"]) unless ENV.key?("TEST") -end - -namespace :test do - task "lib" => "test:prepare" do - $LOAD_PATH << "test" - Rails::TestUnit::Runner.rake_run(["test/lib"]) - end -end