Conversation
ce709aa
to
4b9d1c6
Compare
4b9d1c6
to
c1e50c5
Compare
c1e50c5
to
7d5925c
Compare
7d5925c
to
4b7467d
Compare
This new environment will be used for smoke testing only. E.g. RAILS_ENV=smoke_test TEST_URL=... bundle exec rake spec:features A new environment is required since RSpec requires a DB to be running and connected to in order to run the tests. We could delete the constant ActiveRecord e.g. Object.send(:remove_const, :ActiveRecord), but I decided to use a new env that doesn't load it instead. Alternative approaches: - We could use https://github.com/nulldb/nulldb rather than not requiring ActiveRecord - There might be a way to use rspec/rspec-rails#2266 but I don't think it helps our situations, since we do need ActiveRecord.
4b7467d
to
553bbb7
Compare
@@ -141,7 +141,7 @@ jobs: | |||
- task: run-smoke-tests | |||
file: govuk-coronavirus-business-volunteer-form/concourse/tasks/run-smoke-tests.yml | |||
params: | |||
TEST_URL: 'https://coronavirus-business-volunteers.service.gov.uk/medical-equipment' | |||
TEST_URL: 'https://coronavirus-business-volunteers.service.gov.uk' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go back to the way it was. The /
route redirects back to GOV.UK, and we don't have any feature tests that click "Start now". Probably want to remove the first feature, actually...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry I should've separated this out into another commit for clarity. This change is intended, since TEST_URL
is used by the feature tests as the Capybara.app_host
, so when one writes visit "medical_equipment_path"
behind the scenes this gets translated into Capybara.app_host + path
or https://coronavirus-business-volunteers.service.gov.uk/medical-equipment
.
The previous commit was broken, so if I left it as-is the calls to visit_path
would take the test browser to e.g. /medical-equipment/medical-equipment/
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes more sense!
This will get the smoke tests working in concourse.
This new environment will be used for smoke testing only.
E.g.
RAILS_ENV=smoke_test TEST_URL=... bundle exec rake spec:features
A new environment is required since RSpec requires a DB to be running
and connected to in order to run the tests. We could delete the constant
ActiveRecord e.g.
Object.send(:remove_const, :ActiveRecord)
, but I decidedto use a new env that doesn't load it instead.
I applied this branch to the pipeline and ran a build with it: https://cd.gds-reliability.engineering/teams/govuk-tools/pipelines/govuk-corona-business-volunteer-form/jobs/smoke-test-staging/builds/124
Alternative approaches:
ActiveRecord
https://trello.com/c/g66yEmsa/44-run-feature-tests-against-staging-in-the-business-volunteers-pipeline