From 1ceac5ecf6d8703f4909afa6dcb42aa272eb00f6 Mon Sep 17 00:00:00 2001 From: rahuljain-dev Date: Thu, 7 Sep 2023 10:46:03 +0530 Subject: [PATCH] WEBUI-1260: need to downgrade chrome browser version --- .github/workflows/a11y.yaml | 70 +++++++++++---------- .github/workflows/action.yml | 42 +++++++++++++ .github/workflows/cross-repo.yaml | 66 +++++++++---------- .github/workflows/ftest.yaml | 30 +++++---- .github/workflows/main.yaml | 55 ++++++++-------- packages/nuxeo-web-ui-ftest/package.json | 6 +- packages/nuxeo-web-ui-ftest/scripts/test.js | 7 ++- plugin/a11y/getDriverVersion.js | 7 ++- 8 files changed, 166 insertions(+), 117 deletions(-) create mode 100644 .github/workflows/action.yml diff --git a/.github/workflows/a11y.yaml b/.github/workflows/a11y.yaml index a1d0f16628..422a6e9f93 100644 --- a/.github/workflows/a11y.yaml +++ b/.github/workflows/a11y.yaml @@ -18,7 +18,7 @@ on: PACKAGES_AUTH_USER: description: 'PACKAGES_AUTH_USER' required: true - PACKAGES_AUTH_TOKEN: + PACKAGES_AUTH_TOKEN: description: 'PACKAGES_AUTH_TOKEN' required: true @@ -31,41 +31,45 @@ jobs: a11y: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - ref: ${{ env.BRANCH_NAME }} + - uses: actions/checkout@v2 + with: + ref: ${{ env.BRANCH_NAME }} - - run: git config user.name "nuxeo-webui-jx-bot" && git config user.email "webui@hyland.com" + - run: git config user.name "nuxeo-webui-jx-bot" && git config user.email "webui@hyland.com" - - uses: actions/setup-node@v3 - with: - registry-url: ${{ env.NPM_REPOSITORY }} - node-version: 14 - scope: '@nuxeo' + - uses: actions/setup-node@v3 + with: + registry-url: ${{ env.NPM_REPOSITORY }} + node-version: 14 + scope: '@nuxeo' - - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: '17' + - uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '17' - - name: 'Update settings.xml with server configuration' - run: | - echo ' - - - maven-internal - ${{ secrets.PACKAGES_AUTH_USER }} - ${{ secrets.PACKAGES_AUTH_TOKEN }} - - - ' > ~/.m2/settings.xml + - 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.90-1_amd64.deb + apt install -y --allow-downgrades ./google-chrome-stable_114.0.5735.90-1_amd64.deb + ln -s /usr/bin/google-chrome /usr/bin/chrome + chrome --version - - name: Web UI build - run: mvn -B -ntp install + - name: 'Update settings.xml with server configuration' + run: | + echo ' + + + maven-internal + ${{ secrets.PACKAGES_AUTH_USER }} + ${{ secrets.PACKAGES_AUTH_TOKEN }} + + + ' > ~/.m2/settings.xml - #================================================================================================================== - # 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 - #================================================================================================================== \ No newline at end of file + - name: Web UI build + run: mvn -B -ntp 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..87e8cae869 --- /dev/null +++ b/.github/workflows/action.yml @@ -0,0 +1,42 @@ +name: 'Install Google Chrome' +description: 'Install Google Chrome' + +on: + pull_request: + branches: + - maintenance-3.1.x + workflow_call: + inputs: + branch: + description: 'The current branch' + default: maintenance-3.1.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.1.x + NPM_REPOSITORY: https://packages.nuxeo.com/repository/npm-public/ + BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'maintenance-3.1.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.90-1_amd64.deb + sudo apt install -y --allow-downgrades ./google-chrome-stable_114.0.5735.90-1_amd64.deb + sudo ln -s /usr/bin/google-chrome /usr/bin/chrome + chrome --version diff --git a/.github/workflows/cross-repo.yaml b/.github/workflows/cross-repo.yaml index eb97676ccf..dc2a58cc41 100644 --- a/.github/workflows/cross-repo.yaml +++ b/.github/workflows/cross-repo.yaml @@ -58,7 +58,7 @@ jobs: build: name: Build needs: id - runs-on: [ self-hosted, master ] + runs-on: [self-hosted, master] steps: - name: Build parameters run: echo '${{ toJSON(github.event.inputs) }}' @@ -67,9 +67,9 @@ jobs: with: registry-url: ${{ env.NPM_REPOSITORY }} scope: '@nuxeo' - + - uses: actions/setup-java@v2 - with: + with: distribution: 'zulu' java-version: '17' @@ -171,39 +171,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() }} @@ -236,4 +228,4 @@ jobs: name: packages path: | plugin/web-ui/marketplace/target/nuxeo-web-ui-marketplace-*.zip - plugin/itests/marketplace/target/nuxeo-web-ui-marketplace-itests-*.zip \ No newline at end of file + plugin/itests/marketplace/target/nuxeo-web-ui-marketplace-itests-*.zip diff --git a/.github/workflows/ftest.yaml b/.github/workflows/ftest.yaml index dc85747fad..699566cffc 100644 --- a/.github/workflows/ftest.yaml +++ b/.github/workflows/ftest.yaml @@ -18,7 +18,7 @@ on: PACKAGES_AUTH_USER: description: 'PACKAGES_AUTH_USER' required: true - PACKAGES_AUTH_TOKEN: + PACKAGES_AUTH_TOKEN: description: 'PACKAGES_AUTH_TOKEN' required: true @@ -29,7 +29,7 @@ env: jobs: ftests: - runs-on: [ self-hosted, master ] + runs-on: [self-hosted, master] steps: - uses: actions/checkout@v2 with: @@ -41,10 +41,18 @@ jobs: scope: '@nuxeo' - uses: actions/setup-java@v2 - with: + with: distribution: 'zulu' java-version: '17' + - 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.90-1_amd64.deb + apt install -y --allow-downgrades ./google-chrome-stable_114.0.5735.90-1_amd64.deb + ln -s /usr/bin/google-chrome /usr/bin/chrome + chrome --version + - name: Determine nuxeo-elements branch to link id: pick_nuxeo_elements_branch run: | @@ -113,15 +121,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() }} @@ -153,4 +157,4 @@ jobs: name: packages path: | plugin/web-ui/marketplace/target/nuxeo-web-ui-marketplace-*.zip - plugin/itests/marketplace/target/nuxeo-web-ui-marketplace-itests-*.zip \ No newline at end of file + plugin/itests/marketplace/target/nuxeo-web-ui-marketplace-itests-*.zip diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 83a8a200df..5dc944ac1c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -22,34 +22,35 @@ jobs: 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-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.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 - #================================================================================================================== + action: + uses: nuxeo/nuxeo-web-ui/.github/workflows/action.yml@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 + + 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.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 build: - needs: [lint, test] + needs: [action, lint, test, a11y, ftest] runs-on: [self-hosted, master] steps: - uses: actions/checkout@v2 @@ -157,4 +158,4 @@ jobs: run: | pushd packages/nuxeo-web-ui-ftest/ npm publish --@nuxeo:registry=https://packages.nuxeo.com/repository/npm-public/ --tag SNAPSHOT - popd \ No newline at end of file + popd diff --git a/packages/nuxeo-web-ui-ftest/package.json b/packages/nuxeo-web-ui-ftest/package.json index 019e2d1438..ab7a675c06 100644 --- a/packages/nuxeo-web-ui-ftest/package.json +++ b/packages/nuxeo-web-ui-ftest/package.json @@ -19,10 +19,10 @@ "@babel/register": "^7.14.5", "@cucumber/cucumber": "^7.0.0", "@cucumber/tag-expressions": "^2.0.4", - "@wdio/cli": "^7.20.5", + "@wdio/cli": "7.20.5", "@wdio/cucumber-framework": "^7.20.3", - "@wdio/local-runner": "^7.2.0", - "@wdio/selenium-standalone-service": "^7.2.0", + "@wdio/local-runner": "7.2.0", + "@wdio/selenium-standalone-service": "7.2.0", "@wdio/spec-reporter": "^7.2.0", "@wdio/sync": "^7.2.0", "babel-plugin-transform-rename-import": "^2.3.0", diff --git a/packages/nuxeo-web-ui-ftest/scripts/test.js b/packages/nuxeo-web-ui-ftest/scripts/test.js index b1a536aa79..45e627e22e 100755 --- a/packages/nuxeo-web-ui-ftest/scripts/test.js +++ b/packages/nuxeo-web-ui-ftest/scripts/test.js @@ -114,9 +114,12 @@ if (process.env.DRIVER_VERSION == null) { console.log(`${version} detected.`); const match = version && version.match(/([0-9]+)\./); if (match) { - const checkVersion = match[1]; + // this line of code has been commented on due to some driver issues, + // we will resume it once WEBUI-1267 is resolved. + // const checkVersion = match[1]; try { - done = fetch(`https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${checkVersion}`).then((response) => { + // we will update dynamci release version once WEBUI-1267 is resolved + done = fetch(`https://chromedriver.storage.googleapis.com/LATEST_RELEASE_114`).then((response) => { if (response.ok) { return response .text() diff --git a/plugin/a11y/getDriverVersion.js b/plugin/a11y/getDriverVersion.js index a57a97209d..cc67ba888f 100644 --- a/plugin/a11y/getDriverVersion.js +++ b/plugin/a11y/getDriverVersion.js @@ -13,9 +13,12 @@ try { } const match = version && version.match(/([0-9]+)\./); if (match) { - const checkVersion = match[1]; + // this line of code has been commented on due to some driver issues, + // we will resume it once WEBUI-1266 is resolved. + // const checkVersion = match[1]; try { - fetch(`https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${checkVersion}`).then((response) => { + // we will update dynamci release version once WEBUI-1266 is resolved + fetch(`https://chromedriver.storage.googleapis.com/LATEST_RELEASE_114`).then((response) => { if (response.ok) { return response .text()