From 1f3c8fdc63184a0cd11ab2de0d426b1ff7f2cae3 Mon Sep 17 00:00:00 2001 From: rahuljain-dev Date: Wed, 6 Sep 2023 18:14:18 +0530 Subject: [PATCH 1/3] test CI pipeline with downgrade chrome version --- .github/workflows/a11y.yaml | 8 +-- .github/workflows/action.yml | 13 +++++ .github/workflows/cross-repo.yaml | 58 +++++++++------------ .github/workflows/ftest.yaml | 14 ++--- .github/workflows/main.yaml | 44 +++++++--------- packages/nuxeo-web-ui-ftest/scripts/test.js | 2 +- plugin/a11y/getDriverVersion.js | 2 +- 7 files changed, 65 insertions(+), 76 deletions(-) create mode 100644 .github/workflows/action.yml diff --git a/.github/workflows/a11y.yaml b/.github/workflows/a11y.yaml index 1cc6e77155..8aa4d21ebe 100644 --- a/.github/workflows/a11y.yaml +++ b/.github/workflows/a11y.yaml @@ -63,9 +63,5 @@ jobs: - name: Web UI build run: mvn -B -ntp install - #================================================================================================================== - # this line of code has been commented on due to some driver issues, we will resume it once WEBUI-1266 is resolved. - #================================================================================================================== - # - name: A11y checks - # run: mvn -B -ntp -f plugin/a11y install - #================================================================================================================== + - name: A11y checks + run: mvn -B -ntp -f plugin/a11y install diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml new file mode 100644 index 0000000000..63fbb0947e --- /dev/null +++ b/.github/workflows/action.yml @@ -0,0 +1,13 @@ +name: 'Install Google Chrome' +description: 'Install Google Chrome' + +runs: + using: "composite" + steps: + - name: Install google chrome + shell: bash + run: | + wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.133-1_amd64.deb + sudo apt install -y --allow-downgrades ./google-chrome-stable_114.0.5735.133-1_amd64.deb + sudo ln -s /usr/bin/google-chrome /usr/bin/chrome + chrome --version \ No newline at end of file diff --git a/.github/workflows/cross-repo.yaml b/.github/workflows/cross-repo.yaml index dfad3aefdc..4b09321b20 100644 --- a/.github/workflows/cross-repo.yaml +++ b/.github/workflows/cross-repo.yaml @@ -168,39 +168,31 @@ jobs: ' > ~/.m2/settings.xml - #================================================================================================================== - # this line of code has been commented on due to some driver issues, we will resume it once WEBUI-1267 is resolved. - #================================================================================================================== - # - name: Nuxeo package build and Ftests - # env: - # RUN_ALL: ${{ github.event.inputs.run_all }} - # BAIL: ${{ github.event.inputs.bail }} - # run: | - # profiles=() - # if [ ${{ github.event.inputs.skip_ftests }} = "false" ] - # then - # profiles+=('ftest') - # fi - # if ${{ github.event.inputs.generate_metrics }} - # then - # profiles+=('metrics') - # fi - # active_profiles="" - # if [ ${#profiles[@]} -gt 0 ] - # then - # active_profiles="-P$(printf -v active_profiles '%s,' "${profiles[@]}" && echo "${active_profiles%,}")" - # fi - # mvn install -ntp $active_profiles -DskipInstall - #================================================================================================================== - - #================================================================================================================== - # this line of code has been commented on due to some driver issues, we will resume it once WEBUI-1266 is resolved. - #================================================================================================================== - # - name: A11y checks - # if: ${{ github.event.inputs.skip_a11y == 'false' }} - # run: | - # mvn -B -nsu -f plugin/a11y -ntp install - #================================================================================================================== + - name: Nuxeo package build and Ftests + env: + RUN_ALL: ${{ github.event.inputs.run_all }} + BAIL: ${{ github.event.inputs.bail }} + run: | + profiles=() + if [ ${{ github.event.inputs.skip_ftests }} = "false" ] + then + profiles+=('ftest') + fi + if ${{ github.event.inputs.generate_metrics }} + then + profiles+=('metrics') + fi + active_profiles="" + if [ ${#profiles[@]} -gt 0 ] + then + active_profiles="-P$(printf -v active_profiles '%s,' "${profiles[@]}" && echo "${active_profiles%,}")" + fi + mvn install -ntp $active_profiles -DskipInstall + + - name: A11y checks + if: ${{ github.event.inputs.skip_a11y == 'false' }} + run: | + mvn -B -nsu -f plugin/a11y -ntp install - name: Archive cucumber reports if: ${{ always() }} diff --git a/.github/workflows/ftest.yaml b/.github/workflows/ftest.yaml index 886e31a487..ef95a8aeaa 100644 --- a/.github/workflows/ftest.yaml +++ b/.github/workflows/ftest.yaml @@ -113,15 +113,11 @@ jobs: ' > ~/.m2/settings.xml - #================================================================================================================== - # this line of code has been commented on due to some driver issues, we will resume it once WEBUI-1267 is resolved. - #================================================================================================================== - # - name: Functional tests - # env: - # RUN_ALL: false - # BAIL: 0 - # run: mvn -ntp install -Pftest -DskipInstall - #================================================================================================================== + - name: Functional tests + env: + RUN_ALL: false + BAIL: 0 + run: mvn -ntp install -Pftest -DskipInstall - name: Archive cucumber reports if: ${{ always() }} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 881527c05c..460b8cb545 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -22,34 +22,26 @@ jobs: with: branch: maintenance-3.0.x - #================================================================================================================== - # this line of code has been commented on due to some driver issues, we will resume it once WEBUI-1266 is resolved. - #================================================================================================================== - # a11y: - # uses: nuxeo/nuxeo-web-ui/.github/workflows/a11y.yaml@maintenance-3.1.x - # secrets: - # NPM_PACKAGES_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} - # PACKAGES_AUTH_USER: ${{ secrets.PACKAGES_AUTH_USER }} - # PACKAGES_AUTH_TOKEN: ${{ secrets.PACKAGES_AUTH_TOKEN }} - # with: - # branch: maintenance-3.1.x - #================================================================================================================== - - #================================================================================================================== - # this line of code has been commented on due to some driver issues, we will resume it once WEBUI-1267 is resolved. - #================================================================================================================== - # ftest: - # uses: nuxeo/nuxeo-web-ui/.github/workflows/ftest.yaml@maintenance-3.0.x - # secrets: - # NPM_PACKAGES_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} - # PACKAGES_AUTH_USER: ${{ secrets.PACKAGES_AUTH_USER }} - # PACKAGES_AUTH_TOKEN: ${{ secrets.PACKAGES_AUTH_TOKEN }} - # with: - # branch: maintenance-3.0.x - #================================================================================================================== + a11y: + uses: nuxeo/nuxeo-web-ui/.github/workflows/a11y.yaml@maintenance-3.1.x + secrets: + NPM_PACKAGES_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} + PACKAGES_AUTH_USER: ${{ secrets.PACKAGES_AUTH_USER }} + PACKAGES_AUTH_TOKEN: ${{ secrets.PACKAGES_AUTH_TOKEN }} + with: + branch: maintenance-3.1.x + + ftest: + uses: nuxeo/nuxeo-web-ui/.github/workflows/ftest.yaml@maintenance-3.0.x + secrets: + NPM_PACKAGES_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} + PACKAGES_AUTH_USER: ${{ secrets.PACKAGES_AUTH_USER }} + PACKAGES_AUTH_TOKEN: ${{ secrets.PACKAGES_AUTH_TOKEN }} + with: + branch: maintenance-3.0.x build: - needs: [ lint, test ] + needs: [ lint, test, a11y, ftest ] runs-on: [ self-hosted, master ] steps: - uses: actions/checkout@v2 diff --git a/packages/nuxeo-web-ui-ftest/scripts/test.js b/packages/nuxeo-web-ui-ftest/scripts/test.js index b1a536aa79..94b125b6bf 100755 --- a/packages/nuxeo-web-ui-ftest/scripts/test.js +++ b/packages/nuxeo-web-ui-ftest/scripts/test.js @@ -114,7 +114,7 @@ if (process.env.DRIVER_VERSION == null) { console.log(`${version} detected.`); const match = version && version.match(/([0-9]+)\./); if (match) { - const checkVersion = match[1]; + const checkVersion = 114; try { done = fetch(`https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${checkVersion}`).then((response) => { if (response.ok) { diff --git a/plugin/a11y/getDriverVersion.js b/plugin/a11y/getDriverVersion.js index a57a97209d..cd68bf81d1 100644 --- a/plugin/a11y/getDriverVersion.js +++ b/plugin/a11y/getDriverVersion.js @@ -13,7 +13,7 @@ try { } const match = version && version.match(/([0-9]+)\./); if (match) { - const checkVersion = match[1]; + const checkVersion = 114; try { fetch(`https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${checkVersion}`).then((response) => { if (response.ok) { From 04d888a3c51f75941d33deafc142c74801039a11 Mon Sep 17 00:00:00 2001 From: rahuljain-dev Date: Wed, 6 Sep 2023 21:39:01 +0530 Subject: [PATCH 2/3] test Chrome downgrade afer matching config --- .github/workflows/action.yml | 51 ++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 63fbb0947e..70859ae951 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -1,13 +1,42 @@ name: 'Install Google Chrome' description: 'Install Google Chrome' - -runs: - using: "composite" - steps: - - name: Install google chrome - shell: bash - run: | - wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.133-1_amd64.deb - sudo apt install -y --allow-downgrades ./google-chrome-stable_114.0.5735.133-1_amd64.deb - sudo ln -s /usr/bin/google-chrome /usr/bin/chrome - chrome --version \ No newline at end of file + +on: + pull_request: + branches: + - maintenance-3.0.x + workflow_call: + inputs: + branch: + description: 'The current branch' + default: maintenance-3.0.x + type: string + required: false + secrets: + NPM_PACKAGES_TOKEN: + description: 'NPM_PACKAGES_TOKEN' + required: true + PACKAGES_AUTH_USER: + description: 'PACKAGES_AUTH_USER' + required: true + PACKAGES_AUTH_TOKEN: + description: 'PACKAGES_AUTH_TOKEN' + required: true + +env: + REFERENCE_BRANCH: maintenance-3.0.x + NPM_REPOSITORY: https://packages.nuxeo.com/repository/npm-public/ + BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'maintenance-3.0.x' }} + +jobs: + action: + runs: + using: 'composite' + steps: + - name: Install google chrome + shell: bash + run: | + wget -q https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.133-1_amd64.deb + sudo apt install -y --allow-downgrades ./google-chrome-stable_114.0.5735.133-1_amd64.deb + sudo ln -s /usr/bin/google-chrome /usr/bin/chrome + chrome --version From 931baa24078418531e487b550f71a0114c62922a Mon Sep 17 00:00:00 2001 From: rakeshkumar1019 Date: Thu, 7 Sep 2023 11:48:06 +0530 Subject: [PATCH 3/3] test --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5f3cfedd17..4d2ac7a834 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,5 +1,5 @@ name: Test - +# test on: pull_request: branches: