From ba653ab059fc1f79255fd8ca3de6c99f71a9951d Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Wed, 25 Oct 2023 02:02:30 +0000 Subject: [PATCH 1/7] [CI] Run plugin functional tests within Github Previously Plugin functional tests were not execute within the Github actions. Building and running the tests with: ``` node scripts/functional_tests.js --config test/plugin_functional/config.js ``` Signed-off-by: Kawika Avilla --- .github/workflows/build_and_test_workflow.yml | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/.github/workflows/build_and_test_workflow.yml b/.github/workflows/build_and_test_workflow.yml index a9175ad23f8b..8dd1ee022ae1 100644 --- a/.github/workflows/build_and_test_workflow.yml +++ b/.github/workflows/build_and_test_workflow.yml @@ -125,6 +125,87 @@ jobs: id: integration-tests run: yarn test:jest_integration:ci + plugin-functional-tests: + name: Run plugin functional tests on ${{ matrix.name }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + include: + - os: ubuntu-latest + name: Linux + - os: windows-latest + name: Windows + runs-on: ${{ matrix.os }} + steps: + - run: echo Running plugin functional tests + + - name: Configure git's autocrlf (Windows only) + if: matrix.os == 'windows-latest' + run: | + git config --global core.autocrlf false + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup JDK (Windows only) + if: matrix.os == 'windows-latest' + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' + + - name: Setup Yarn + run: | + npm uninstall -g yarn + npm i -g yarn@1.22.10 + yarn config set network-timeout 1000000 -g + + - name: Configure Yarn Cache (Linux) + if: matrix.os != 'windows-latest' + run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV + + - name: Initialize Yarn Cache + uses: actions/cache@v3 + if: matrix.os != 'windows-latest' + with: + path: ${{ env.YARN_CACHE_LOCATION }} + key: yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + yarn- + + - name: Setup chromedriver + run: node scripts/upgrade_chromedriver.js + + - name: Run bootstrap (Linux) + if: matrix.os != 'windows-latest' + run: yarn osd bootstrap + + - name: Run bootstrap (Windows) + if: matrix.os == 'windows-latest' + run: yarn osd bootstrap || yarn osd bootstrap + + - name: Build plugins + run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10 --scan-dir "./test/plugin_functional/plugins" + + - name: Run CI test group ${{ matrix.group }} + id: plugin-ftr-tests + run: node scripts/functional_tests.js --config test/plugin_functional/config.js + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: failure-artifacts-plugin-functional-${{ matrix.os }} + path: | + test/*/failure_debug/ + test/*/screenshots/ + functional-tests: name: Run functional tests on ${{ matrix.name }} (ciGroup${{ matrix.group }}) strategy: From 494ac712656eeeb3d6c0dd02d68127d2c6b1b119 Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Wed, 25 Oct 2023 02:15:40 +0000 Subject: [PATCH 2/7] skip Signed-off-by: abbyhu2000 --- .github/workflows/build_and_test_workflow.yml | 190 +--------------- .github/workflows/cypress_workflow.yml | 210 ------------------ test/plugin_functional/config.ts | 18 +- 3 files changed, 11 insertions(+), 407 deletions(-) delete mode 100644 .github/workflows/cypress_workflow.yml diff --git a/.github/workflows/build_and_test_workflow.yml b/.github/workflows/build_and_test_workflow.yml index 8dd1ee022ae1..50821a254ba2 100644 --- a/.github/workflows/build_and_test_workflow.yml +++ b/.github/workflows/build_and_test_workflow.yml @@ -28,103 +28,6 @@ env: NODE_OPTIONS: "--max-old-space-size=6144 --dns-result-order=ipv4first" jobs: - build-lint-test: - name: Build and Verify on ${{ matrix.name }} (ciGroup${{ matrix.group }}) - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - group: [1, 2, 3, 4] - include: - - os: ubuntu-latest - name: Linux - - os: windows-latest - name: Windows - runs-on: ${{ matrix.os }} - steps: - - name: Configure git's autocrlf (Windows only) - if: matrix.os == 'windows-latest' - run: | - git config --global core.autocrlf false - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup JDK (Windows only) - if: matrix.os == 'windows-latest' - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'adopt' - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' - - - name: Setup Yarn - run: | - npm uninstall -g yarn - npm i -g yarn@1.22.10 - yarn config set network-timeout 1000000 -g - - - name: Configure Yarn Cache (Linux) - if: matrix.os != 'windows-latest' - run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV - - - name: Initialize Yarn Cache - uses: actions/cache@v3 - if: matrix.os != 'windows-latest' - with: - path: ${{ env.YARN_CACHE_LOCATION }} - key: yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - yarn- - - - name: Run bootstrap (Linux) - if: matrix.os != 'windows-latest' - run: yarn osd bootstrap - - - name: Run bootstrap (Windows) - if: matrix.os == 'windows-latest' - run: yarn osd bootstrap || yarn osd bootstrap - - - name: Run linter - # ciGroup 1 of unit-tests is shorter and Linux is faster - if: matrix.group == 1 && matrix.os == 'ubuntu-latest' - id: linter - run: yarn lint - - - name: Validate NOTICE file - # ciGroup 1 of unit-tests is shorter and Linux is faster - if: matrix.group == 1 && matrix.os == 'ubuntu-latest' - id: notice-validate - run: yarn notice:validate - - - name: Run unit tests group ${{ matrix.group }} with coverage - id: unit-tests - run: yarn test:jest:ci:coverage --ci-group=${{ matrix.group }} - - - name: Run mocha tests with coverage - # ciGroup 1 of unit-tests is shorter - if: matrix.group == 1 - id: mocha-tests - run: yarn test:mocha:coverage - - - name: Upload Code Coverage - id: upload-code-coverage - uses: codecov/codecov-action@v3 - with: - directory: ./target/opensearch-dashboards-coverage - flags: ${{ matrix.name }}_${{ matrix.group }} - - - name: Run integration tests - # ciGroup 1 of unit-tests is shorter - if: matrix.group == 1 - id: integration-tests - run: yarn test:jest_integration:ci - plugin-functional-tests: name: Run plugin functional tests on ${{ matrix.name }} strategy: @@ -206,94 +109,7 @@ jobs: test/*/failure_debug/ test/*/screenshots/ - functional-tests: - name: Run functional tests on ${{ matrix.name }} (ciGroup${{ matrix.group }}) - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] - include: - - os: ubuntu-latest - name: Linux - - os: windows-latest - name: Windows - runs-on: ${{ matrix.os }} - steps: - - run: echo Running functional tests for ciGroup${{ matrix.group }} - - - name: Configure git's autocrlf (Windows only) - if: matrix.os == 'windows-latest' - run: | - git config --global core.autocrlf false - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup JDK (Windows only) - if: matrix.os == 'windows-latest' - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'adopt' - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' - - - name: Setup Yarn - run: | - npm uninstall -g yarn - npm i -g yarn@1.22.10 - yarn config set network-timeout 1000000 -g - - - name: Configure Yarn Cache (Linux) - if: matrix.os != 'windows-latest' - run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV - - - name: Initialize Yarn Cache - uses: actions/cache@v3 - if: matrix.os != 'windows-latest' - with: - path: ${{ env.YARN_CACHE_LOCATION }} - key: yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - yarn- - - - name: Setup chromedriver - run: node scripts/upgrade_chromedriver.js - - - name: Run bootstrap (Linux) - if: matrix.os != 'windows-latest' - run: yarn osd bootstrap - - - name: Run bootstrap (Windows) - if: matrix.os == 'windows-latest' - run: yarn osd bootstrap || yarn osd bootstrap - - - name: Build plugins - run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10 - - - name: Run CI test group ${{ matrix.group }} - id: ftr-tests - run: node scripts/functional_tests.js --config test/functional/config.js --include ciGroup${{ matrix.group }} - env: - CI_GROUP: ciGroup${{ matrix.group }} - CI_PARALLEL_PROCESS_NUMBER: ciGroup${{ matrix.group }} - JOB: ci${{ matrix.group }} - CACHE_DIR: ciGroup${{ matrix.group }} - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: failure-artifacts-ci${{ matrix.group }} - path: | - test/*/failure_debug/ - test/*/screenshots/ - - build-min-artifact-tests: + name: Build min release artifacts on ${{ matrix.name }} strategy: matrix: @@ -385,9 +201,7 @@ jobs: with: name: ${{ matrix.suffix }}-${{ env.VERSION }} path: ./artifacts/target/${{ env.ARTIFACT_BUILD_NAME }} - retention-days: 1 - - bwc-tests: + retention-days: needs: [build-min-artifact-tests] runs-on: ubuntu-latest container: diff --git a/.github/workflows/cypress_workflow.yml b/.github/workflows/cypress_workflow.yml deleted file mode 100644 index 1853aad0d69b..000000000000 --- a/.github/workflows/cypress_workflow.yml +++ /dev/null @@ -1,210 +0,0 @@ -name: Run cypress tests - -# trigger on every PR for all branches -on: - pull_request: - branches: [ '**' ] - paths-ignore: - - '**/*.md' - workflow_dispatch: - inputs: - test_repo: - description: 'Cypress test repo' - default: 'opensearch-project/opensearch-dashboards-functional-test' - required: true - type: string - test_branch: - description: 'Cypress test branch (default: source branch)' - required: false - type: string - specs: - description: 'Tests to run (default: osd:ciGroup)' - required: false - type: string - pr_number: - description: 'PR Number (optional)' - required: false - type: number - -env: - TEST_REPO: ${{ inputs.test_repo != '' && inputs.test_repo || 'opensearch-project/opensearch-dashboards-functional-test' }} - TEST_BRANCH: "${{ inputs.test_branch != '' && inputs.test_branch || github.base_ref }}" - FTR_PATH: 'ftr' - START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true' - OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false' - CYPRESS_BROWSER: 'chromium' - CYPRESS_VISBUILDER_ENABLED: true - CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false - OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true - NODE_OPTIONS: '--max-old-space-size=6144 --dns-result-order=ipv4first' - COMMENT_TAG: '[MANUAL CYPRESS TEST RUN RESULTS]' - COMMENT_SUCCESS_MSG: ':white_check_mark: Cypress test run succeeded!' - COMMENT_FAILURE_MSG: ':x: Cypress test run failed!' - -jobs: - cypress-tests: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - group: [1, 2, 3, 4, 5, 6, 7, 8, 9] - container: - image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2 - options: --user 1001 - env: - # prevents extra Cypress installation progress messages - CI: 1 - # avoid warnings like "tput: No value for $TERM and no -T specified" - TERM: xterm - name: Run cypress tests (osd:ciGroup${{ matrix.group }}) - steps: - - name: Get source information from PR number - if: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number != '' }} - id: get_pr_info - uses: actions/github-script@v6 - with: - script: | - const { data: result } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: ${{ inputs.pr_number }} - }); - core.setOutput('head_name', result.head.repo.full_name); - core.setOutput('head_ref', result.head.ref); - - - name: Set source repo from PR number - if: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number != '' }} - run: | - echo "SOURCE_REPO=${{ steps.get_pr_info.outputs.head_name }}" >> $GITHUB_ENV - echo "SOURCE_BRANCH=${{ steps.get_pr_info.outputs.head_ref }}" >> $GITHUB_ENV - - - name: Checkout code - uses: actions/checkout@v2 - with: - repository: ${{ env.SOURCE_REPO }} - ref: '${{ env.SOURCE_BRANCH }}' - - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' - - - name: Setup Yarn - run: | - npm uninstall -g yarn - npm i -g yarn@1.22.10 - - - name: Run bootstrap - run: yarn osd bootstrap - - - name: Build plugins - run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 12 - - - name: Checkout - uses: actions/checkout@v2 - with: - path: ${{ env.FTR_PATH }} - repository: ${{ env.TEST_REPO }} - ref: '${{ env.TEST_BRANCH }}' - - - name: Setup spec files by input - if: ${{ inputs.specs != '' }} - run: | - echo "SPEC=${{ inputs.specs }}" >> $GITHUB_ENV - - - name: Setup spec files - if: ${{ inputs.specs == '' }} - working-directory: ${{ env.FTR_PATH }} - shell: bash - run: | - IFS="," read -a SPEC_ARRAY <<< $(yarn --silent osd:ciGroup${{ matrix.group }}) - FORMATTED_SPEC='' - for i in "${SPEC_ARRAY[@]}"; do - FORMATTED_SPEC+="cypress/integration/core-opensearch-dashboards/opensearch-dashboards/${i}," - done - echo "SPEC=${FORMATTED_SPEC}" >> $GITHUB_ENV - - - name: Get Cypress version - id: cypress_version - run: | - echo "::set-output name=cypress_version::$(cat ./${{ env.FTR_PATH }}/package.json | jq '.devDependencies.cypress' | tr -d '"')" - - - name: Cache Cypress - id: cache-cypress - uses: actions/cache@v1 - with: - path: ~/.cache/Cypress - key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('**/package.json') }} - env: - CYPRESS_INSTALL_BINARY: ${{ steps.cypress_version.outputs.cypress_version }} - - run: npx cypress cache list - - run: npx cypress cache path - - - name: Run tests - uses: cypress-io/github-action@v2 - with: - working-directory: ${{ env.FTR_PATH }} - start: ${{ env.OPENSEARCH_SNAPSHOT_CMD }}, ${{ env.START_CMD }} - wait-on: 'http://localhost:9200, http://localhost:5601' - command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.SPEC }} - - # Screenshots are only captured on failure, will change this once we do visual regression tests - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: ftr-cypress-screenshots - path: ${{ env.FTR_PATH }}/cypress/screenshots - retention-days: 1 - - - uses: actions/upload-artifact@v3 - if: always() - with: - name: ftr-cypress-videos - path: ${{ env.FTR_PATH }}/cypress/videos - retention-days: 1 - - - uses: actions/upload-artifact@v3 - if: always() - with: - name: ftr-cypress-results - path: ${{ env.FTR_PATH }}/cypress/results - retention-days: 1 - - add-comment: - needs: [cypress-tests] - if: ${{ always() && github.event_name == 'workflow_dispatch' && inputs.pr_number != '' }} - permissions: - pull-requests: write - runs-on: ubuntu-latest - steps: - - name: Find Comment - uses: peter-evans/find-comment@v2 - id: fc - with: - issue-number: ${{ inputs.pr_number }} - comment-author: 'github-actions[bot]' - body-includes: "${{ env.COMMENT_TAG }}" - - - name: Add comment on the PR - uses: peter-evans/create-or-update-comment@v3 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ inputs.pr_number }} - body: | - ### ${{ env.COMMENT_TAG }} - - #### ${{ needs.cypress-tests.result == 'success' && env.COMMENT_SUCCESS_MSG || env.COMMENT_FAILURE_MSG }} - - #### Inputs: - ``` - Test repo: '${{ env.TEST_REPO }}' - Test branch: '${{ env.TEST_BRANCH }}' - - Test spec: - '${{ env.SPEC }}' - ``` - - #### Link to results: - ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - edit-mode: replace diff --git a/test/plugin_functional/config.ts b/test/plugin_functional/config.ts index ce027815a57f..af2f8ffe397d 100644 --- a/test/plugin_functional/config.ts +++ b/test/plugin_functional/config.ts @@ -43,16 +43,16 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { return { testFiles: [ - require.resolve('./test_suites/core'), - require.resolve('./test_suites/custom_visualizations'), - require.resolve('./test_suites/panel_actions'), - require.resolve('./test_suites/core_plugins'), - require.resolve('./test_suites/management'), - require.resolve('./test_suites/doc_views'), + // require.resolve('./test_suites/core'), + // require.resolve('./test_suites/custom_visualizations'), + // require.resolve('./test_suites/panel_actions'), + // require.resolve('./test_suites/core_plugins'), + // require.resolve('./test_suites/management'), + // require.resolve('./test_suites/doc_views'), require.resolve('./test_suites/doc_views_links'), - require.resolve('./test_suites/application_links'), - require.resolve('./test_suites/data_plugin'), - require.resolve('./test_suites/dashboard_listing_plugin'), + // require.resolve('./test_suites/application_links'), + // require.resolve('./test_suites/data_plugin'), + // require.resolve('./test_suites/dashboard_listing_plugin'), ], services: { ...functionalConfig.get('services'), From ee52dbf5f99083eccda6f21c01b25e57d8c0955d Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Wed, 25 Oct 2023 02:18:14 +0000 Subject: [PATCH 3/7] no more js Signed-off-by: Kawika Avilla --- .github/workflows/build_and_test_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test_workflow.yml b/.github/workflows/build_and_test_workflow.yml index 50821a254ba2..0529291520f3 100644 --- a/.github/workflows/build_and_test_workflow.yml +++ b/.github/workflows/build_and_test_workflow.yml @@ -99,7 +99,7 @@ jobs: - name: Run CI test group ${{ matrix.group }} id: plugin-ftr-tests - run: node scripts/functional_tests.js --config test/plugin_functional/config.js + run: node scripts/functional_tests.js --config test/plugin_functional/config.ts - uses: actions/upload-artifact@v3 if: failure() From b066c1a9f1d5fd40c3ed9bbacfa248f1ef6d7ac7 Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Wed, 25 Oct 2023 02:19:55 +0000 Subject: [PATCH 4/7] fix try #1 Signed-off-by: abbyhu2000 --- .../test_suites/doc_views_links/doc_views_links.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/plugin_functional/test_suites/doc_views_links/doc_views_links.ts b/test/plugin_functional/test_suites/doc_views_links/doc_views_links.ts index 1b1fee37f80c..08c34753fc0a 100644 --- a/test/plugin_functional/test_suites/doc_views_links/doc_views_links.ts +++ b/test/plugin_functional/test_suites/doc_views_links/doc_views_links.ts @@ -61,7 +61,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide await waitFor(async () => (await browser.getAllWindowHandles()).length > originalTabCount); // switch to the originalTabCount in case previous tab is not closed in time - await browser.switchTab(originalTabCount); + //await browser.switchTab(originalTabCount); const currentUrl = await browser.getCurrentUrl(); expect(currentUrl).to.eql('http://some-url/'); @@ -80,7 +80,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide await waitFor(async () => (await browser.getAllWindowHandles()).length > originalTabCount); // switch to the originalTabCount in case previous tab is not closed in time - await browser.switchTab(originalTabCount); + //await browser.switchTab(originalTabCount); const currentUrl = await browser.getCurrentUrl(); expect(currentUrl).to.eql('http://some-url/'); From 250d41bacadc0f6ba31ab0666131f973ad4074f3 Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Wed, 25 Oct 2023 02:22:04 +0000 Subject: [PATCH 5/7] fix file Signed-off-by: Kawika Avilla --- .github/workflows/build_and_test_workflow.yml | 174 +----------------- 1 file changed, 1 insertion(+), 173 deletions(-) diff --git a/.github/workflows/build_and_test_workflow.yml b/.github/workflows/build_and_test_workflow.yml index 0529291520f3..f9ea5a554b17 100644 --- a/.github/workflows/build_and_test_workflow.yml +++ b/.github/workflows/build_and_test_workflow.yml @@ -107,176 +107,4 @@ jobs: name: failure-artifacts-plugin-functional-${{ matrix.os }} path: | test/*/failure_debug/ - test/*/screenshots/ - - - name: Build min release artifacts on ${{ matrix.name }} - strategy: - matrix: - include: - - os: ubuntu-latest - name: Linux x64 - ext: tar.gz - suffix: linux-x64 - script: build-platform --linux --skip-os-packages - - os: ubuntu-latest - name: Linux ARM64 - ext: tar.gz - suffix: linux-arm64 - script: build-platform --linux-arm --skip-os-packages - - os: windows-latest - name: Windows x64 - ext: zip - suffix: windows-x64 - script: build-platform --windows --skip-os-packages - runs-on: ${{ matrix.os }} - defaults: - run: - working-directory: ./artifacts - steps: - - name: Configure git's autocrlf (Windows only) - if: matrix.os == 'windows-latest' - run: | - git config --global core.autocrlf false - working-directory: . - - - name: Checkout code - uses: actions/checkout@v3 - with: - path: ./artifacts - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version-file: './artifacts/.nvmrc' - registry-url: 'https://registry.npmjs.org' - - - name: Setup Yarn - run: | - npm uninstall -g yarn - npm i -g yarn@1.22.10 - yarn config set network-timeout 1000000 -g - - - name: Configure Yarn Cache (Linux) - if: matrix.os != 'windows-latest' - run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV - - - name: Initialize Yarn Cache - uses: actions/cache@v3 - if: matrix.os != 'windows-latest' - with: - path: ${{ env.YARN_CACHE_LOCATION }} - key: yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - yarn- - - - name: Get package version (Linux) - if: matrix.os != 'windows-latest' - run: | - echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV - - - name: Get artifact build name (Linux) - if: matrix.os != 'windows-latest' - run: | - echo "ARTIFACT_BUILD_NAME=opensearch-dashboards-${{ env.VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}" >> $GITHUB_ENV - - - name: Get package version (Windows) - if: matrix.os == 'windows-latest' - run: | - echo "VERSION=$(yarn --silent pkg-version)" >> $env:GITHUB_ENV - - - name: Get artifact build name (Windows) - if: matrix.os == 'windows-latest' - run: | - echo "ARTIFACT_BUILD_NAME=opensearch-dashboards-${{ env.VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}" >> $env:GITHUB_ENV - - - name: Run bootstrap - run: yarn osd bootstrap - - - name: Build `${{ matrix.name }}` - run: yarn ${{ matrix.script }} --release - - - uses: actions/upload-artifact@v3 - if: success() - with: - name: ${{ matrix.suffix }}-${{ env.VERSION }} - path: ./artifacts/target/${{ env.ARTIFACT_BUILD_NAME }} - retention-days: - needs: [build-min-artifact-tests] - runs-on: ubuntu-latest - container: - image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2 - options: --user 1001 - name: Run backwards compatibility tests - defaults: - run: - working-directory: ./artifacts - strategy: - matrix: - version: [osd-2.0.0, osd-2.1.0, osd-2.2.0, osd-2.3.0, osd-2.4.0, osd-2.5.0, osd-2.6.0, osd-2.7.0, osd-2.8.0, osd-2.9.0] - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - path: ./artifacts - - - run: echo Running backwards compatibility tests for version ${{ matrix.version }} - - run: echo [NOTE] These tests will be ran using Linux x64 release builds without security - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version-file: './artifacts/.nvmrc' - registry-url: 'https://registry.npmjs.org' - - - name: Setup Yarn - run: | - npm uninstall -g yarn - npm i -g yarn@1.22.10 - yarn config set network-timeout 1000000 -g - - - name: Get package version - run: | - echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV - - - name: Set OpenSearch URL - run: | - echo "OPENSEARCH_URL=https://artifacts.opensearch.org/snapshots/core/opensearch/${{ env.VERSION }}-SNAPSHOT/opensearch-min-${{ env.VERSION }}-SNAPSHOT-linux-x64-latest.tar.gz" >> $GITHUB_ENV - - - name: Verify if OpenSearch is available for version - id: verify-opensearch-exists - run: | - if curl -I -L ${{ env.OPENSEARCH_URL }}; then - echo "::set-output name=version-exists::true" - fi - - - name: Skipping tests - if: steps.verify-opensearch-exists.outputs.version-exists != 'true' - run: echo Tests were skipped because an OpenSearch release build does not exist for this version yet! - - - name: Setting environment variable to run tests for ${{ matrix.version }} - if: steps.verify-opensearch-exists.outputs.version-exists == 'true' - run: echo "BWC_VERSIONS=${{ matrix.version }}" >> $GITHUB_ENV - - - name: Download OpenSearch Dashboards - uses: actions/download-artifact@v3 - id: download - with: - name: linux-x64-${{ env.VERSION }} - path: ./artifacts/ - if: steps.verify-opensearch-exists.outputs.version-exists == 'true' - - - name: Run tests - if: steps.verify-opensearch-exists.outputs.version-exists == 'true' - run: | - ./bwctest.sh -s false -o ${{ env.OPENSEARCH_URL }} -d ${{ steps.download.outputs.download-path }}/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz - - - uses: actions/upload-artifact@v3 - if: ${{ failure() && steps.verify-opensearch-exists.outputs.version-exists == 'true' }} - with: - name: ${{ matrix.version }}-test-failures - path: | - ./artifacts/bwc_tmp/test/cypress/videos/* - ./artifacts/bwc_tmp/test/cypress/screenshots/* - ./artifacts/bwc_tmp/test/cypress/results/* - retention-days: 1 + test/*/screenshots/ \ No newline at end of file From e5f373c28a4fbaab91f606385910ea5c81d5107c Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Fri, 27 Oct 2023 01:04:01 +0000 Subject: [PATCH 6/7] Skip custom doc link test Signed-off-by: abbyhu2000 --- test/plugin_functional/config.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/plugin_functional/config.ts b/test/plugin_functional/config.ts index af2f8ffe397d..6d4f153b92f7 100644 --- a/test/plugin_functional/config.ts +++ b/test/plugin_functional/config.ts @@ -43,16 +43,16 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { return { testFiles: [ - // require.resolve('./test_suites/core'), - // require.resolve('./test_suites/custom_visualizations'), - // require.resolve('./test_suites/panel_actions'), - // require.resolve('./test_suites/core_plugins'), - // require.resolve('./test_suites/management'), - // require.resolve('./test_suites/doc_views'), - require.resolve('./test_suites/doc_views_links'), - // require.resolve('./test_suites/application_links'), - // require.resolve('./test_suites/data_plugin'), - // require.resolve('./test_suites/dashboard_listing_plugin'), + require.resolve('./test_suites/core'), + require.resolve('./test_suites/custom_visualizations'), + require.resolve('./test_suites/panel_actions'), + require.resolve('./test_suites/core_plugins'), + require.resolve('./test_suites/management'), + require.resolve('./test_suites/doc_views'), + // require.resolve('./test_suites/doc_views_links'), + require.resolve('./test_suites/application_links'), + require.resolve('./test_suites/data_plugin'), + require.resolve('./test_suites/dashboard_listing_plugin'), ], services: { ...functionalConfig.get('services'), From e9ce23e2e5c9711e31fc53288fe0c1ce4adb5781 Mon Sep 17 00:00:00 2001 From: abbyhu2000 Date: Fri, 27 Oct 2023 01:09:54 +0000 Subject: [PATCH 7/7] Change test name Signed-off-by: abbyhu2000 --- .github/workflows/build_and_test_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test_workflow.yml b/.github/workflows/build_and_test_workflow.yml index f9ea5a554b17..8daa751dd7c3 100644 --- a/.github/workflows/build_and_test_workflow.yml +++ b/.github/workflows/build_and_test_workflow.yml @@ -97,7 +97,7 @@ jobs: - name: Build plugins run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10 --scan-dir "./test/plugin_functional/plugins" - - name: Run CI test group ${{ matrix.group }} + - name: Run functional plugin tests id: plugin-ftr-tests run: node scripts/functional_tests.js --config test/plugin_functional/config.ts