Skip to content

Commit

Permalink
Parallelise integration tests
Browse files Browse the repository at this point in the history
This separates out the two runs done by integration
tests: one with preview_design_system permissions
and one without. Each is run in a separate workflow.
I opted to make separate worksflows to make it easy
to delete the preview_design_system workflow once
fully ported over to the design system.
  • Loading branch information
Jonathan Young committed Oct 12, 2023
1 parent 3d27a9c commit d1610ab
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
name: Test Ruby
uses: ./.github/workflows/minitest.yml

integration-tests-parallel:
name: Integration tests
uses: ./.github/workflows/integration-tests-parallel.yml

integration-tests:
name: Integration tests
runs-on: ubuntu-latest
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/integration-tests-parallel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Run integration tests

on: workflow_call

jobs:
run-parallel-integration-tests:
name: Run integration tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node_rake_task: ["cucumber:ok", "cucumber:preview_design_system"]
steps:
- name: Setup MySQL
id: setup-mysql
uses: alphagov/govuk-infrastructure/.github/actions/setup-mysql@main

- name: Setup Redis
uses: alphagov/govuk-infrastructure/.github/actions/setup-redis@main

- name: Install additional system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ghostscript
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Setup Node
uses: alphagov/govuk-infrastructure/.github/actions/setup-node@main

- name: Precompile assets
uses: alphagov/govuk-infrastructure/.github/actions/precompile-rails-assets@main

- name: Initialize database
env:
RAILS_ENV: test
TEST_DATABASE_URL: ${{ steps.setup-mysql.outputs.db-url }}
run: bundle exec rails db:setup

- name: Run cucumber
env:
RAILS_ENV: test
TEST_DATABASE_URL: ${{ steps.setup-mysql.outputs.db-url }}
run: bundle exec rails ${{ matrix.node_rake_task }}

- name: Upload screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: capybara-screenshots
path: tmp/capybara/capybara-*.png

0 comments on commit d1610ab

Please sign in to comment.