From e429100522a489e371262bbd9cd761d5e7d3e655 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 15:05:20 +0100 Subject: [PATCH 01/23] ci: setup CI --- .github/workflows/build_app.yml | 66 +++++++++++ .../ci_additional_authorization_handler.yml | 80 ++++--------- .github/workflows/test_app.yml | 108 ++++++++++++++++++ 3 files changed, 198 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/build_app.yml create mode 100644 .github/workflows/test_app.yml diff --git a/.github/workflows/build_app.yml b/.github/workflows/build_app.yml new file mode 100644 index 0000000..db908ff --- /dev/null +++ b/.github/workflows/build_app.yml @@ -0,0 +1,66 @@ +on: + workflow_call: + inputs: + ruby_version: + description: 'Ruby Version' + default: "3.2.2" + type: string + required: false + node_version: + description: 'Node version' + default: '18.17.1' + required: false + type: string +jobs: + build_app: + name: Build app + runs-on: ubuntu-22.04 + if: "!startsWith(github.head_ref, 'chore/l10n')" + timeout-minutes: 60 + env: + DATABASE_USERNAME: postgres + DATABASE_PASSWORD: postgres + DATABASE_HOST: localhost + RUBYOPT: '-W:no-deprecated' + services: + postgres: + image: postgres:14 + ports: ["5432:5432"] + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + POSTGRES_PASSWORD: postgres + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ inputs.ruby_version }} + bundler-cache: true + - uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node_version }} + cache: 'npm' + cache-dependency-path: ./package-lock.json + - uses: actions/cache@v4 + id: app-cache + with: + path: ./spec/decidim_dummy_app/ + key: app-${{ github.sha }} + restore-keys: app-${{ github.sha }} + - run: bundle exec rake test_app + name: Create test app + shell: "bash" + - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots + name: Create the screenshots folder + shell: "bash" + - run: RAILS_ENV=test bundle exec rails shakapacker:compile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ + shell: "bash" + env: + NODE_ENV: "test" diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index d41abdf..f2e2613 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -8,6 +8,9 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" env: CI: "true" @@ -15,63 +18,28 @@ env: NODE_VERSION: 18.17.1 concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: true jobs: + build_app: + uses: ./.github/workflows/build_app.yml + secrets: inherit + name: Build test application + main: - name: Tests - runs-on: ubuntu-latest - timeout-minutes: 30 - services: - postgres: - image: postgres:14 - ports: ["5432:5432"] - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - env: - POSTGRES_PASSWORD: postgres - env: - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: postgres - DATABASE_HOST: localhost - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Get npm cache directory path - id: npm-cache-dir-path - run: echo "dir=$(npm get cache)-additional_authorization_handler" >> $GITHUB_OUTPUT - - uses: actions/cache@v4 - id: npm-cache - with: - path: ${{ steps.npm-cache-dir-path.outputs.dir }} - key: npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - npm- - - run: bundle exec rake test_app - name: Create test app - - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots - name: Create the screenshots folder - - uses: nanasess/setup-chromedriver@v2 - - run: RAILS_ENV=test bundle exec rails shakapacker:compile - name: Precompile assets - working-directory: ./spec/decidim_dummy_app/ - - run: bundle exec rspec - name: RSpec - - uses: codecov/codecov-action@v4 - - uses: actions/upload-artifact@v4 - if: always() - with: - name: screenshots - path: ./spec/decidim_dummy_app/tmp/screenshots - if-no-files-found: ignore + strategy: + fail-fast: false + matrix: + test: + - command: bundle exec parallel_test --type rspec --pattern spec/ --exclude-pattern spec/system + name: "Unit tests" + - command: bundle exec parallel_test --type rspec --pattern spec/system --exclude-pattern spec/system/admin + name: "System tests" + needs: build_app + name: ${{ matrix.test.name }} + uses: ./.github/workflows/test_app.yml + secrets: inherit + with: + working-directory: "decidim-module-addtional_authorization_handler" + test_command: ${{ matrix.test.command }} diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml new file mode 100644 index 0000000..3aeda34 --- /dev/null +++ b/.github/workflows/test_app.yml @@ -0,0 +1,108 @@ +on: + workflow_call: + inputs: + ruby_version: + description: 'Ruby Version' + default: "3.2.2" + required: false + type: string + working-directory: + required: true + type: string + test_command: + description: 'The testing command to be ran' + required: true + type: string + chrome_version: + description: 'Chrome & Chromedriver version' + required: false + default: "126.0.6478.182" + type: string + +jobs: + build_app: + name: Test + runs-on: ubuntu-latest + if: "!startsWith(github.head_ref, 'chore/l10n')" + timeout-minutes: 60 + env: + DATABASE_USERNAME: postgres + DATABASE_PASSWORD: postgres + DATABASE_HOST: localhost + RUBYOPT: '-W:no-deprecated' + services: + validator: + image: ghcr.io/validator/validator:latest + ports: ["8888:8888"] + postgres: + image: postgres:14 + ports: ["5432:5432"] + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + POSTGRES_PASSWORD: postgres + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ inputs.ruby_version }} + - run: | + sudo apt update + sudo apt install libu2f-udev + wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${{inputs.chrome_version}}-1_amd64.deb + sudo dpkg -i /tmp/chrome.deb + rm /tmp/chrome.deb + - uses: nanasess/setup-chromedriver@v2 + with: + chromedriver-version: ${{inputs.chrome_version}} + name: Install Chrome version ${{inputs.chrome_version}} + - uses: actions/cache@v4 + id: app-cache + with: + path: ./spec/decidim_dummy_app/ + key: app-${{ github.sha }} + restore-keys: app-${{ github.sha }} + - run: | + bundle install + bundle exec rake parallel:create parallel:load_schema + name: Parallel tests + shell: "bash" + working-directory: ./spec/decidim_dummy_app/ + - run: | + sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional + ${{ inputs.test_command }} + name: RSpec + working-directory: ${{ inputs.working-directory }} + env: + VALIDATOR_HTML_URI: http://localhost:8888/ + RUBY_VERSION: ${{ inputs.ruby_version }} + DECIDIM_MODULE: ${{ inputs.working-directory }} + DISPLAY: ":99" + CI: "true" + SIMPLECOV: "true" + SHAKAPACKER_RUNTIME_COMPILE: "false" + NODE_ENV: "test" + - uses: codecov/codecov-action@v3 + name: Upload coverage + with: + name: ${{ inputs.working-directory }} + flags: ${{ inputs.working-directory }} + - uses: actions/upload-artifact@v4 + if: always() + with: + name: screenshots + path: ./spec/decidim_dummy_app/tmp/screenshots + if-no-files-found: ignore + overwrite: true From cfc84fdd03f6afc9572b146bb548aa16b27429e2 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 15:23:35 +0100 Subject: [PATCH 02/23] ci: add lint to CI --- .../ci_additional_authorization_handler.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index f2e2613..4a5040e 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -27,6 +27,20 @@ jobs: secrets: inherit name: Build test application + lint: + name: Lint code + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 + if: "github.ref != 'refs/heads/develop'" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - uses: OpenSourcePolitics/lint-action@master + with: + ruby_version: ${{ env.RUBY_VERSION }} + node_version: ${{ env.NODE_VERSION }} + main: strategy: fail-fast: false From 057cdec257ca2021f02407079a4dd0921a3a2392 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 15:31:53 +0100 Subject: [PATCH 03/23] fix: typo in ci file --- .github/workflows/ci_additional_authorization_handler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index 4a5040e..2b8164f 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -55,5 +55,5 @@ jobs: uses: ./.github/workflows/test_app.yml secrets: inherit with: - working-directory: "decidim-module-addtional_authorization_handler" + working-directory: "decidim-module-additional_authorization_handler" test_command: ${{ matrix.test.command }} From 1eb154f345f8c20da100b744c7c492610d2bdf87 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 15:51:47 +0100 Subject: [PATCH 04/23] fix: update CI to run tests --- .../ci_additional_authorization_handler.yml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index 2b8164f..3c255dc 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -41,19 +41,19 @@ jobs: ruby_version: ${{ env.RUBY_VERSION }} node_version: ${{ env.NODE_VERSION }} - main: - strategy: - fail-fast: false - matrix: - test: - - command: bundle exec parallel_test --type rspec --pattern spec/ --exclude-pattern spec/system - name: "Unit tests" - - command: bundle exec parallel_test --type rspec --pattern spec/system --exclude-pattern spec/system/admin - name: "System tests" - needs: build_app - name: ${{ matrix.test.name }} - uses: ./.github/workflows/test_app.yml - secrets: inherit - with: - working-directory: "decidim-module-additional_authorization_handler" - test_command: ${{ matrix.test.command }} + tests: + name: Tests + needs: build_app + uses: ./.github/workflows/test_app.yml + with: + command: "bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb'" + secrets: inherit + + system_tests: + name: System tests + needs: build_app + uses: ./.github/workflows/test_app.yml + with: + command: "bundle exec rspec spec/system" + secrets: inherit + From 81e613cb890f082c8c0d41315a27a0c3e22d5235 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 15:55:02 +0100 Subject: [PATCH 05/23] fix: add working directory to CI --- .github/workflows/ci_additional_authorization_handler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index 3c255dc..0adc813 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -55,5 +55,5 @@ jobs: uses: ./.github/workflows/test_app.yml with: command: "bundle exec rspec spec/system" + working-directory: "decidim-module-additional_authorization_handler" secrets: inherit - From bbce57a10760504f9e91e6e03c936b772c7d0e3c Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 15:58:45 +0100 Subject: [PATCH 06/23] fix: update CI with test_command and missing working-directory --- .github/workflows/ci_additional_authorization_handler.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index 0adc813..a5f57c7 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -46,7 +46,8 @@ jobs: needs: build_app uses: ./.github/workflows/test_app.yml with: - command: "bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb'" + test_command: "bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb'" + working-directory: "decidim-module-additional_authorization_handler" secrets: inherit system_tests: @@ -54,6 +55,6 @@ jobs: needs: build_app uses: ./.github/workflows/test_app.yml with: - command: "bundle exec rspec spec/system" + test_command: "bundle exec rspec spec/system" working-directory: "decidim-module-additional_authorization_handler" secrets: inherit From e6bd7a2e89365ecdab5847ed51a51db6e41bbe14 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 16:15:04 +0100 Subject: [PATCH 07/23] fix: delete parallel test from test_app file --- .github/workflows/test_app.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index 3aeda34..c522016 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -74,12 +74,6 @@ jobs: path: ./spec/decidim_dummy_app/ key: app-${{ github.sha }} restore-keys: app-${{ github.sha }} - - run: | - bundle install - bundle exec rake parallel:create parallel:load_schema - name: Parallel tests - shell: "bash" - working-directory: ./spec/decidim_dummy_app/ - run: | sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} From 1bc628907ace49041de89136565c8c723acfc757 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 16:35:07 +0100 Subject: [PATCH 08/23] fix: update working-directory --- .github/workflows/ci_additional_authorization_handler.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index a5f57c7..9acb496 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -47,7 +47,7 @@ jobs: uses: ./.github/workflows/test_app.yml with: test_command: "bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb'" - working-directory: "decidim-module-additional_authorization_handler" + working-directory: / secrets: inherit system_tests: @@ -56,5 +56,5 @@ jobs: uses: ./.github/workflows/test_app.yml with: test_command: "bundle exec rspec spec/system" - working-directory: "decidim-module-additional_authorization_handler" + working-directory: / secrets: inherit From e8cfb5b745dcbeef989f34a405427bfed136ab24 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 17:14:29 +0100 Subject: [PATCH 09/23] fix: try updating workflow --- .github/workflows/ci_additional_authorization_handler.yml | 4 ++-- .github/workflows/test_app.yml | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index 9acb496..a5f57c7 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -47,7 +47,7 @@ jobs: uses: ./.github/workflows/test_app.yml with: test_command: "bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb'" - working-directory: / + working-directory: "decidim-module-additional_authorization_handler" secrets: inherit system_tests: @@ -56,5 +56,5 @@ jobs: uses: ./.github/workflows/test_app.yml with: test_command: "bundle exec rspec spec/system" - working-directory: / + working-directory: "decidim-module-additional_authorization_handler" secrets: inherit diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index c522016..5f085f5 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -7,7 +7,7 @@ on: required: false type: string working-directory: - required: true + required: false type: string test_command: description: 'The testing command to be ran' @@ -90,9 +90,6 @@ jobs: NODE_ENV: "test" - uses: codecov/codecov-action@v3 name: Upload coverage - with: - name: ${{ inputs.working-directory }} - flags: ${{ inputs.working-directory }} - uses: actions/upload-artifact@v4 if: always() with: From c5680461536fffd61185f196fcc8dc12631d1e09 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 17:22:28 +0100 Subject: [PATCH 10/23] fix: another try to fix ci workflow --- .github/workflows/ci_additional_authorization_handler.yml | 2 -- .github/workflows/test_app.yml | 7 ++----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index a5f57c7..3a95dc8 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -47,7 +47,6 @@ jobs: uses: ./.github/workflows/test_app.yml with: test_command: "bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb'" - working-directory: "decidim-module-additional_authorization_handler" secrets: inherit system_tests: @@ -56,5 +55,4 @@ jobs: uses: ./.github/workflows/test_app.yml with: test_command: "bundle exec rspec spec/system" - working-directory: "decidim-module-additional_authorization_handler" secrets: inherit diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index 5f085f5..d42c6c0 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -6,9 +6,6 @@ on: default: "3.2.2" required: false type: string - working-directory: - required: false - type: string test_command: description: 'The testing command to be ran' required: true @@ -78,11 +75,11 @@ jobs: sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} name: RSpec - working-directory: ${{ inputs.working-directory }} + working-directory: ./ env: VALIDATOR_HTML_URI: http://localhost:8888/ RUBY_VERSION: ${{ inputs.ruby_version }} - DECIDIM_MODULE: ${{ inputs.working-directory }} + DECIDIM_MODULE: "decidim-module-additional_authorization_handler" DISPLAY: ":99" CI: "true" SIMPLECOV: "true" From cd1ff650953b213bd86fe3906d487bafe3bebc42 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 17:33:09 +0100 Subject: [PATCH 11/23] fix: add bundle install in test_app file --- .github/workflows/test_app.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index d42c6c0..900f665 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -71,6 +71,11 @@ jobs: path: ./spec/decidim_dummy_app/ key: app-${{ github.sha }} restore-keys: app-${{ github.sha }} + - run: | + bundle install + name: Install gems + shell: "bash" + working-directory: ./spec/decidim_dummy_app/ - run: | sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} From 481d29aea9b91e514ed82751215d3077d09c8168 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 17:46:00 +0100 Subject: [PATCH 12/23] fix: lint in test_app file --- .github/workflows/test_app.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index 900f665..14b8812 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -73,9 +73,9 @@ jobs: restore-keys: app-${{ github.sha }} - run: | bundle install - name: Install gems - shell: "bash" - working-directory: ./spec/decidim_dummy_app/ + name: Install gems + shell: "bash" + working-directory: ./spec/decidim_dummy_app/ - run: | sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} From 50b9600968da9c7caf89ee0f3f42edbda742fbc5 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 17:58:33 +0100 Subject: [PATCH 13/23] fix: update test_app ci file --- .github/workflows/test_app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index 14b8812..eab3637 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -80,7 +80,7 @@ jobs: sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} name: RSpec - working-directory: ./ + working-directory: ./spec/decidim_dummy_app/ env: VALIDATOR_HTML_URI: http://localhost:8888/ RUBY_VERSION: ${{ inputs.ruby_version }} From 8195fb951eb6560cbefd26d2470e1e181b75dc96 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Mon, 16 Dec 2024 18:12:02 +0100 Subject: [PATCH 14/23] fix: update ci to run all tests together --- .../workflows/ci_additional_authorization_handler.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index 3a95dc8..1e496f1 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -46,13 +46,5 @@ jobs: needs: build_app uses: ./.github/workflows/test_app.yml with: - test_command: "bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb'" - secrets: inherit - - system_tests: - name: System tests - needs: build_app - uses: ./.github/workflows/test_app.yml - with: - test_command: "bundle exec rspec spec/system" + test_command: "bundle exec rspec" secrets: inherit From 8bf08ec22d255ef1e32f7eb78ccdf098c5a31395 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Tue, 17 Dec 2024 08:58:41 +0100 Subject: [PATCH 15/23] fix: command in ci --- .github/workflows/ci_additional_authorization_handler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index 1e496f1..ddb25d6 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -46,5 +46,5 @@ jobs: needs: build_app uses: ./.github/workflows/test_app.yml with: - test_command: "bundle exec rspec" + test_command: "bundle exec rspec spec" secrets: inherit From e5072c3a053cb8d16581c7100170b35f7fce5466 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Tue, 17 Dec 2024 09:10:39 +0100 Subject: [PATCH 16/23] fix: remove workin directory for rspec --- .github/workflows/test_app.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index eab3637..c83f679 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -80,7 +80,6 @@ jobs: sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} name: RSpec - working-directory: ./spec/decidim_dummy_app/ env: VALIDATOR_HTML_URI: http://localhost:8888/ RUBY_VERSION: ${{ inputs.ruby_version }} From 9feaf0350ea63bb9d6d0447053d19ddb618c3cd9 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Tue, 17 Dec 2024 09:22:37 +0100 Subject: [PATCH 17/23] fix: add command for test database --- .github/workflows/test_app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index c83f679..549f074 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -73,6 +73,7 @@ jobs: restore-keys: app-${{ github.sha }} - run: | bundle install + bundle exec rake db:drop db:create db:migrate db:seed name: Install gems shell: "bash" working-directory: ./spec/decidim_dummy_app/ From 984214d6f0f3c789b62ce8b9e61795feff88225d Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Tue, 17 Dec 2024 09:54:38 +0100 Subject: [PATCH 18/23] fix: update test_app file --- .github/workflows/test_app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index 549f074..14b8812 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -73,7 +73,6 @@ jobs: restore-keys: app-${{ github.sha }} - run: | bundle install - bundle exec rake db:drop db:create db:migrate db:seed name: Install gems shell: "bash" working-directory: ./spec/decidim_dummy_app/ @@ -81,6 +80,7 @@ jobs: sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} name: RSpec + working-directory: ./ env: VALIDATOR_HTML_URI: http://localhost:8888/ RUBY_VERSION: ${{ inputs.ruby_version }} From 45789d8f0ad9efb1404444bcdb792182311e0c11 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Tue, 17 Dec 2024 10:12:13 +0100 Subject: [PATCH 19/23] fix: update working directory --- .github/workflows/test_app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index 14b8812..593d7c1 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -80,7 +80,7 @@ jobs: sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} name: RSpec - working-directory: ./ + working-directory: / env: VALIDATOR_HTML_URI: http://localhost:8888/ RUBY_VERSION: ${{ inputs.ruby_version }} From 98128cdc5478cb9ed47050f766e3b16395cf8800 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Tue, 17 Dec 2024 10:29:58 +0100 Subject: [PATCH 20/23] fix: another update of test_app --- .github/workflows/test_app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index 593d7c1..eab3637 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -80,7 +80,7 @@ jobs: sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} name: RSpec - working-directory: / + working-directory: ./spec/decidim_dummy_app/ env: VALIDATOR_HTML_URI: http://localhost:8888/ RUBY_VERSION: ${{ inputs.ruby_version }} From e1ba88402525b1913d828a99a376023fdd0119b4 Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Tue, 17 Dec 2024 10:42:23 +0100 Subject: [PATCH 21/23] fix: update in test_app and ci file --- .github/workflows/ci_additional_authorization_handler.yml | 2 +- .github/workflows/test_app.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index ddb25d6..1e496f1 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -46,5 +46,5 @@ jobs: needs: build_app uses: ./.github/workflows/test_app.yml with: - test_command: "bundle exec rspec spec" + test_command: "bundle exec rspec" secrets: inherit diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index eab3637..315c90d 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -80,7 +80,7 @@ jobs: sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} name: RSpec - working-directory: ./spec/decidim_dummy_app/ + working-directory: ./spec env: VALIDATOR_HTML_URI: http://localhost:8888/ RUBY_VERSION: ${{ inputs.ruby_version }} From c092b6a8fde82ec418812ff6709733daf39e43ee Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Tue, 17 Dec 2024 10:55:50 +0100 Subject: [PATCH 22/23] fix: updating again test_app and ci --- .github/workflows/ci_additional_authorization_handler.yml | 2 +- .github/workflows/test_app.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_additional_authorization_handler.yml b/.github/workflows/ci_additional_authorization_handler.yml index 1e496f1..d0d94c7 100644 --- a/.github/workflows/ci_additional_authorization_handler.yml +++ b/.github/workflows/ci_additional_authorization_handler.yml @@ -46,5 +46,5 @@ jobs: needs: build_app uses: ./.github/workflows/test_app.yml with: - test_command: "bundle exec rspec" + test_command: "bundle exec rspec --pattern './spec/**/*_spec.rb'" secrets: inherit diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index 315c90d..14b8812 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -80,7 +80,7 @@ jobs: sudo Xvfb -ac $DISPLAY -screen 0 1920x1084x24 > /dev/null 2>&1 & # optional ${{ inputs.test_command }} name: RSpec - working-directory: ./spec + working-directory: ./ env: VALIDATOR_HTML_URI: http://localhost:8888/ RUBY_VERSION: ${{ inputs.ruby_version }} From fde3e21c574d5d883725dbbc01a047790cb9fcee Mon Sep 17 00:00:00 2001 From: stephanie rousset Date: Tue, 17 Dec 2024 11:10:52 +0100 Subject: [PATCH 23/23] fix: add create db and load schema in test_app --- .github/workflows/test_app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_app.yml b/.github/workflows/test_app.yml index 14b8812..0727185 100644 --- a/.github/workflows/test_app.yml +++ b/.github/workflows/test_app.yml @@ -73,7 +73,8 @@ jobs: restore-keys: app-${{ github.sha }} - run: | bundle install - name: Install gems + bundle exec rake db:create db:schema:load + name: Install gems and create db shell: "bash" working-directory: ./spec/decidim_dummy_app/ - run: |