Skip to content

Commit

Permalink
build: ability to quarentine flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantk committed Dec 6, 2023
1 parent b23eaff commit 3e15589
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 5 deletions.
64 changes: 61 additions & 3 deletions .github/workflows/ci-full-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,68 @@ jobs:
-e FAF_FRAMEWORK_ENDPOINT=http://faf.test \
-e CI_NODE_TOTAL=${{ matrix.ci_node_total }} \
-e CI_NODE_INDEX=${{ matrix.ci_node_index }} \
-e CI=1 \
-v ${PWD}/coverage/coverage-${{ matrix.ci_node_index }}:/srv/app/coverage \
${{ needs.build_test.outputs.docker_image }} \
bash -c "bundle exec rake knapsack:rspec || bundle exec rspec --only-failure"
bash -c "bundle exec rake 'knapsack:rspec[--tag ~flaky]' || bundle exec rspec --only-failure"
rspec_quarentine:
name: Checks - Rspec (Quarantined tests)
needs: build_test
runs-on: ubuntu-20.04

services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
redis:
image: redis
ports:
- 6379:6379
chrome:
image: selenium/standalone-chrome:95.0-chromedriver-95.0
ports:
- 4444:4444

steps:
- name: Run Rspec tests
run: |
docker run --rm \
--network ${{ job.container.network }} \
-e RAILS_ENV=test \
-e DATABASE_URL=postgres://postgres:password@postgres:5432/buy-for-your-school-test \
-e DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL="true" \
-e DOCKER=true \
-e SELENIUM_HUB_URL=http://chrome:4444/wd/hub \
-e REDIS_URL=redis://redis:6379 \
-e APPLICATION_URL=http://localhost:3000 \
-e SECRET_KEY_BASE=test \
-e CONTENTFUL_SPACE=test \
-e CONTENTFUL_ENVIRONMENT=master \
-e CONTENTFUL_DELIVERY_TOKEN=123 \
-e CONTENTFUL_PREVIEW_TOKEN=123 \
-e CONTENTFUL_ENTRY_CACHING=false \
-e CONTENTFUL_WEBHOOK_API_KEY=test \
-e NOTIFY_API_KEY=development_team-12345678-1234-1234-1234-abcd12345678-12345678-1234-1234-1234-abcd12345678 \
-e MS_GRAPH_TENANT=test \
-e MS_GRAPH_CLIENT_ID=test \
-e MS_GRAPH_CLIENT_SECRET=test \
-e MS_GRAPH_SHARED_MAILBOX_USER_ID=test \
-e MS_GRAPH_SHARED_MAILBOX_NAME=mailbox \
-e MS_GRAPH_SHARED_MAILBOX_ADDRESS=test@mailbox.com \
-e CLAMAV_REST_SERVICE_URL=test \
-e DSI_ENV=test \
-e DFE_SIGN_IN_IDENTIFIER=service \
-e DFE_SIGN_IN_API_SECRET=secret \
-e PROC_OPS_TEAM="DSI Caseworkers" \
-e QUALTRICS_SURVEY_URL=https://dferesearch.fra1.qualtrics.com \
-e SUPPORT_EMAIL=email@example.gov.uk \
-e FAF_FRAMEWORK_ENDPOINT=http://faf.test \
${{ needs.build_test.outputs.docker_image }} \
bash -c "bundle exec rspec --tag flaky || bundle exec rspec --only-failure"
release_dev:
name: Deploy release (Dev)
Expand Down
2 changes: 1 addition & 1 deletion spec/features/engagement/create_case_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
create_list(:support_organisation, 3, trust_code: group.uid)
end

it "sets the group as the case organisation and participating schools" do
it "sets the group as the case organisation and participating schools", flaky: true do
select_organisation "Group 1"
valid_form_data_without_organisation
click_on "Save and continue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
expect(page).to have_field "Enter an email subject", with: "Case 000001 – DfE Get help buying for schools: your request for advice and guidance"
end

it "shows added recipients" do
it "shows added recipients", flaky: true do
to_table = find("table[data-row-label='TO']")
within(to_table) do
# case email added by default
Expand Down

0 comments on commit 3e15589

Please sign in to comment.