diff --git a/.github/workflows/build_and_test_workflow.yml b/.github/workflows/build_and_test_workflow.yml index ef5c7a4b61d3..d82d0f45bb04 100644 --- a/.github/workflows/build_and_test_workflow.yml +++ b/.github/workflows/build_and_test_workflow.yml @@ -3,10 +3,10 @@ name: Build and test -# trigger on every commit push and PR for all branches except feature branches +# trigger on every commit push and PR for all branches except feature branches and pushes for backport branches on: push: - branches: [ '**', '!feature/**' ] + branches: [ '**', '!feature/**', '!backport/**' ] pull_request: branches: [ '**', '!feature/**' ] @@ -221,6 +221,10 @@ jobs: - 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 @@ -233,4 +237,13 @@ jobs: - 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 \ No newline at end of file + ./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/without-security/* + ./artifacts/bwc_tmp/test/cypress/screenshots/without-security/* + retention-days: 1 diff --git a/cypress/integration/with-security/check_filter_and_query.js b/cypress/integration/with-security/check_filter_and_query.js index 0055e5c078ed..e1a486dcfce5 100644 --- a/cypress/integration/with-security/check_filter_and_query.js +++ b/cypress/integration/with-security/check_filter_and_query.js @@ -12,6 +12,8 @@ import { const miscUtils = new MiscUtils(cy); const commonUI = new CommonUI(cy); const loginPage = new LoginPage(cy); +const startDate = 'Nov 1, 2016 @ 00:00:00.000'; +const endDate = `Dec 31, ${new Date().getFullYear()} @ 00:00:00.000`; describe('check dashboards filter and query', () => { beforeEach(() => { @@ -66,7 +68,7 @@ describe('check dashboards filter and query', () => { .find('[class="osdSavedQueryListItem__labelText"]') .should('have.text', 'test-query') .click(); - commonUI.setDateRange('Dec 1, 2021 @ 00:00:00.000', 'Jan 1, 2021 @ 00:00:00.000'); + commonUI.setDateRange(endDate, startDate); //[Logs] vistor chart should show osx 100% cy.get('[data-title="[Logs] Visitors by OS"]') diff --git a/cypress/integration/without-security/check_filter_and_query.js b/cypress/integration/without-security/check_filter_and_query.js index 30911d05ba7e..65b9aaf4a98b 100644 --- a/cypress/integration/without-security/check_filter_and_query.js +++ b/cypress/integration/without-security/check_filter_and_query.js @@ -10,6 +10,8 @@ import { const miscUtils = new MiscUtils(cy); const commonUI = new CommonUI(cy); +const startDate = 'Nov 1, 2016 @ 00:00:00.000'; +const endDate = `Dec 31, ${new Date().getFullYear()} @ 00:00:00.000`; describe('check dashboards filter and query', () => { beforeEach(() => { @@ -56,7 +58,7 @@ describe('check dashboards filter and query', () => { .find('[class="osdSavedQueryListItem__labelText"]') .should('have.text', 'test-query') .click(); - commonUI.setDateRange('Dec 1, 2021 @ 00:00:00.000', 'Jan 1, 2021 @ 00:00:00.000'); + commonUI.setDateRange(endDate, startDate); //[Logs] vistor chart should show osx 100% cy.get('[data-title="[Logs] Visitors by OS"]')