From 464fd21b35be8ddd34b030785988fb77546f171c Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Thu, 20 Feb 2025 20:57:28 -0800 Subject: [PATCH 1/7] 2.7-reports-fix Signed-off-by: sumukhswamy --- .github/workflows/release-e2e-workflow-template.yml | 6 +++--- .../plugins/reports-dashboards/04-download.spec.js | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-e2e-workflow-template.yml b/.github/workflows/release-e2e-workflow-template.yml index 349dbdf06..dc03863db 100644 --- a/.github/workflows/release-e2e-workflow-template.yml +++ b/.github/workflows/release-e2e-workflow-template.yml @@ -113,19 +113,19 @@ jobs: command: ${{ inputs.test-command }} wait-on: 'http://localhost:5601' # Screenshots are only captured on failure, will change this once we do visual regression tests - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 if: failure() with: name: cypress-screenshots path: cypress-test/cypress/screenshots # Test run video was always captured, so this action uses "always()" condition - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 if: always() with: name: cypress-videos path: cypress-test/cypress/videos # Test reports was always captured, so this action uses "always()" condition - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 if: always() with: name: cypress-results diff --git a/cypress/integration/plugins/reports-dashboards/04-download.spec.js b/cypress/integration/plugins/reports-dashboards/04-download.spec.js index 381fb6ce9..a45f7ce05 100644 --- a/cypress/integration/plugins/reports-dashboards/04-download.spec.js +++ b/cypress/integration/plugins/reports-dashboards/04-download.spec.js @@ -28,6 +28,9 @@ describe('Cypress', () => { }); it('Download from reporting homepage', () => { + cy.intercept('GET', `${BASE_PATH}/api/reporting/generateReport/*`).as( + 'generateReport' + ); cy.visit(`${BASE_PATH}/app/reports-dashboards#/`, { waitForGetTenant: true, }); @@ -40,12 +43,7 @@ describe('Cypress', () => { cy.get('[id="landingPageOnDemandDownload"]') .contains('PDF') .click({ force: true }); - cy.get('body').then(($body) => { - if ($body.find('#downloadInProgressLoadingModal').length > 0) { - return; - } else { - assert(false); - } + cy.wait('@generateReport').its('response.statusCode').should('eq', 200); }); }); From 56db52bea288114b28b2a64bc4b147d91968bcd0 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Thu, 20 Feb 2025 21:05:12 -0800 Subject: [PATCH 2/7] 2.7-reports-fix Signed-off-by: sumukhswamy --- .../plugins/reports-dashboards/04-download.spec.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cypress/integration/plugins/reports-dashboards/04-download.spec.js b/cypress/integration/plugins/reports-dashboards/04-download.spec.js index a45f7ce05..aec20eb12 100644 --- a/cypress/integration/plugins/reports-dashboards/04-download.spec.js +++ b/cypress/integration/plugins/reports-dashboards/04-download.spec.js @@ -32,7 +32,7 @@ describe('Cypress', () => { 'generateReport' ); cy.visit(`${BASE_PATH}/app/reports-dashboards#/`, { - waitForGetTenant: true, + waitForGetTenant: false, }); cy.location('pathname', { timeout: TIMEOUT }).should( 'include', @@ -44,7 +44,6 @@ describe('Cypress', () => { .contains('PDF') .click({ force: true }); cy.wait('@generateReport').its('response.statusCode').should('eq', 200); - }); }); it('Download pdf from in-context menu', () => { @@ -113,7 +112,7 @@ describe('Cypress', () => { // create an on-demand report definition cy.visit(`${BASE_PATH}/app/reports-dashboards#/`, { - waitForGetTenant: true, + waitForGetTenant: false, }); cy.location('pathname', { timeout: TIMEOUT }).should( 'include', From 221d56e517f1d2618d49ec976ef07f7b4ba8b5f6 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Thu, 20 Feb 2025 21:32:44 -0800 Subject: [PATCH 3/7] reverted changes Signed-off-by: sumukhswamy --- .../integration/plugins/reports-dashboards/04-download.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/plugins/reports-dashboards/04-download.spec.js b/cypress/integration/plugins/reports-dashboards/04-download.spec.js index aec20eb12..64810356d 100644 --- a/cypress/integration/plugins/reports-dashboards/04-download.spec.js +++ b/cypress/integration/plugins/reports-dashboards/04-download.spec.js @@ -112,7 +112,7 @@ describe('Cypress', () => { // create an on-demand report definition cy.visit(`${BASE_PATH}/app/reports-dashboards#/`, { - waitForGetTenant: false, + waitForGetTenant: true, }); cy.location('pathname', { timeout: TIMEOUT }).should( 'include', From 17f7e6a7aed6aaa077486b592e23c63c8ee0ad07 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Thu, 20 Feb 2025 21:34:16 -0800 Subject: [PATCH 4/7] reverted changes Signed-off-by: sumukhswamy --- .../integration/plugins/reports-dashboards/04-download.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/plugins/reports-dashboards/04-download.spec.js b/cypress/integration/plugins/reports-dashboards/04-download.spec.js index 64810356d..5aabb34bb 100644 --- a/cypress/integration/plugins/reports-dashboards/04-download.spec.js +++ b/cypress/integration/plugins/reports-dashboards/04-download.spec.js @@ -32,7 +32,7 @@ describe('Cypress', () => { 'generateReport' ); cy.visit(`${BASE_PATH}/app/reports-dashboards#/`, { - waitForGetTenant: false, + waitForGetTenant: true, }); cy.location('pathname', { timeout: TIMEOUT }).should( 'include', From 5a71721a6a5d2a4a4031eac2cabe40882eec4c98 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Fri, 21 Feb 2025 10:44:46 -0800 Subject: [PATCH 5/7] reverted workflow Signed-off-by: sumukhswamy --- .../release-e2e-workflow-template.yml | 54 ++++--------------- 1 file changed, 9 insertions(+), 45 deletions(-) diff --git a/.github/workflows/release-e2e-workflow-template.yml b/.github/workflows/release-e2e-workflow-template.yml index dc03863db..76c30e751 100644 --- a/.github/workflows/release-e2e-workflow-template.yml +++ b/.github/workflows/release-e2e-workflow-template.yml @@ -8,12 +8,6 @@ on: test-command: required: true type: string - osd-serve-args: - required: false - type: string - security-enabled: - required: false - type: string jobs: tests: name: Run Cypress E2E tests for ${{ inputs.test-name }} @@ -37,31 +31,13 @@ jobs: working-directory: cypress-test run: | echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV - - name: Get security setups - run: | - SECURITY_ENABLED=${{ inputs.security-enabled }} - if [ "$SECURITY_ENABLED" != 'false' ]; then - echo "SECURITY_ENABLED=true" >> $GITHUB_ENV - else - echo "SECURITY_ENABLED=false" >> $GITHUB_ENV - fi - name: Get and run OpenSearch run: | wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch/opensearch-${{ env.VERSION }}-linux-x64.tar.gz tar -xzf opensearch-${{ env.VERSION }}-linux-x64.tar.gz cd opensearch-${{ env.VERSION }}/ - if [ "$SECURITY_ENABLED" = 'false' ]; then - echo "Remove OpenSearch Security" - [ -d "plugins/opensearch-security" ] && echo "plugins.security.disabled: true" >> config/opensearch.yml - ./opensearch-tar-install.sh & - timeout 900 bash -c 'while [[ "$(curl -o /dev/null -w ''%{http_code}'' http://localhost:9200)" != "200" ]]; do sleep 5; done' - curl http://localhost:9200 - else - echo "Keep OpenSearch Security" - ./opensearch-tar-install.sh & - timeout 900 bash -c 'while [[ "$(curl -o /dev/null -w ''%{http_code}'' -u admin:admin -k https://localhost:9200)" != "200" ]]; do sleep 5; done' - curl https://localhost:9200 -u admin:admin --insecure - fi + ./opensearch-tar-install.sh & + timeout 900 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' -u admin:admin -k https://localhost:9200)" != "200" ]]; do sleep 5; done' - name: Get OpenSearch-Dashboards run: | wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz @@ -69,7 +45,7 @@ jobs: - name: Get node and yarn versions id: versions run: | - echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")" + echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")" - name: Setup node uses: actions/setup-node@v1 with: @@ -78,20 +54,8 @@ jobs: - name: Run OpenSearch-Dashboards server run: | cd opensearch-dashboards-${{ env.VERSION }} - if [ "$SECURITY_ENABLED" = 'false' ]; then - echo "Remove Dashboards Security" - ./bin/opensearch-dashboards-plugin remove securityDashboards - sed -i /^opensearch_security/d config/opensearch_dashboards.yml - sed -i 's/https/http/' config/opensearch_dashboards.yml - bin/opensearch-dashboards serve ${{ inputs.osd-serve-args }} & - timeout 300 bash -c 'while [[ "$(curl http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done' - curl http://localhost:5601/api/status - else - echo "Keep Dashboards Security" - bin/opensearch-dashboards serve ${{ inputs.osd-serve-args }} & - timeout 300 bash -c 'while [[ "$(curl -u admin:admin -k http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done' - curl http://localhost:5601/api/status -u admin:admin --insecure - fi + bin/opensearch-dashboards serve & + timeout 300 bash -c 'while [[ "$(curl -s -u admin:admin -k localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done' - name: Get Cypress version id: cypress_version run: | @@ -113,20 +77,20 @@ jobs: command: ${{ inputs.test-command }} wait-on: 'http://localhost:5601' # Screenshots are only captured on failure, will change this once we do visual regression tests - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v1 if: failure() with: name: cypress-screenshots path: cypress-test/cypress/screenshots # Test run video was always captured, so this action uses "always()" condition - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v1 if: always() with: name: cypress-videos path: cypress-test/cypress/videos # Test reports was always captured, so this action uses "always()" condition - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v1 if: always() with: name: cypress-results - path: cypress-test/cypress/results + path: cypress-test/cypress/results \ No newline at end of file From 12c20ab5f19cc671691585ccd7e6740dc39a31d7 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Fri, 21 Feb 2025 10:45:58 -0800 Subject: [PATCH 6/7] reverted workflow Signed-off-by: sumukhswamy --- .../release-e2e-workflow-template.yml | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-e2e-workflow-template.yml b/.github/workflows/release-e2e-workflow-template.yml index 76c30e751..349dbdf06 100644 --- a/.github/workflows/release-e2e-workflow-template.yml +++ b/.github/workflows/release-e2e-workflow-template.yml @@ -8,6 +8,12 @@ on: test-command: required: true type: string + osd-serve-args: + required: false + type: string + security-enabled: + required: false + type: string jobs: tests: name: Run Cypress E2E tests for ${{ inputs.test-name }} @@ -31,13 +37,31 @@ jobs: working-directory: cypress-test run: | echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV + - name: Get security setups + run: | + SECURITY_ENABLED=${{ inputs.security-enabled }} + if [ "$SECURITY_ENABLED" != 'false' ]; then + echo "SECURITY_ENABLED=true" >> $GITHUB_ENV + else + echo "SECURITY_ENABLED=false" >> $GITHUB_ENV + fi - name: Get and run OpenSearch run: | wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch/opensearch-${{ env.VERSION }}-linux-x64.tar.gz tar -xzf opensearch-${{ env.VERSION }}-linux-x64.tar.gz cd opensearch-${{ env.VERSION }}/ - ./opensearch-tar-install.sh & - timeout 900 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' -u admin:admin -k https://localhost:9200)" != "200" ]]; do sleep 5; done' + if [ "$SECURITY_ENABLED" = 'false' ]; then + echo "Remove OpenSearch Security" + [ -d "plugins/opensearch-security" ] && echo "plugins.security.disabled: true" >> config/opensearch.yml + ./opensearch-tar-install.sh & + timeout 900 bash -c 'while [[ "$(curl -o /dev/null -w ''%{http_code}'' http://localhost:9200)" != "200" ]]; do sleep 5; done' + curl http://localhost:9200 + else + echo "Keep OpenSearch Security" + ./opensearch-tar-install.sh & + timeout 900 bash -c 'while [[ "$(curl -o /dev/null -w ''%{http_code}'' -u admin:admin -k https://localhost:9200)" != "200" ]]; do sleep 5; done' + curl https://localhost:9200 -u admin:admin --insecure + fi - name: Get OpenSearch-Dashboards run: | wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz @@ -45,7 +69,7 @@ jobs: - name: Get node and yarn versions id: versions run: | - echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")" + echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")" - name: Setup node uses: actions/setup-node@v1 with: @@ -54,8 +78,20 @@ jobs: - name: Run OpenSearch-Dashboards server run: | cd opensearch-dashboards-${{ env.VERSION }} - bin/opensearch-dashboards serve & - timeout 300 bash -c 'while [[ "$(curl -s -u admin:admin -k localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done' + if [ "$SECURITY_ENABLED" = 'false' ]; then + echo "Remove Dashboards Security" + ./bin/opensearch-dashboards-plugin remove securityDashboards + sed -i /^opensearch_security/d config/opensearch_dashboards.yml + sed -i 's/https/http/' config/opensearch_dashboards.yml + bin/opensearch-dashboards serve ${{ inputs.osd-serve-args }} & + timeout 300 bash -c 'while [[ "$(curl http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done' + curl http://localhost:5601/api/status + else + echo "Keep Dashboards Security" + bin/opensearch-dashboards serve ${{ inputs.osd-serve-args }} & + timeout 300 bash -c 'while [[ "$(curl -u admin:admin -k http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done' + curl http://localhost:5601/api/status -u admin:admin --insecure + fi - name: Get Cypress version id: cypress_version run: | @@ -93,4 +129,4 @@ jobs: if: always() with: name: cypress-results - path: cypress-test/cypress/results \ No newline at end of file + path: cypress-test/cypress/results From 6b1f15f26f961070c0135bfdd966c75def7dd612 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Fri, 21 Feb 2025 10:49:42 -0800 Subject: [PATCH 7/7] reverted workflow Signed-off-by: sumukhswamy --- .github/workflows/release-e2e-workflow-template.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-e2e-workflow-template.yml b/.github/workflows/release-e2e-workflow-template.yml index 349dbdf06..dc03863db 100644 --- a/.github/workflows/release-e2e-workflow-template.yml +++ b/.github/workflows/release-e2e-workflow-template.yml @@ -113,19 +113,19 @@ jobs: command: ${{ inputs.test-command }} wait-on: 'http://localhost:5601' # Screenshots are only captured on failure, will change this once we do visual regression tests - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 if: failure() with: name: cypress-screenshots path: cypress-test/cypress/screenshots # Test run video was always captured, so this action uses "always()" condition - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 if: always() with: name: cypress-videos path: cypress-test/cypress/videos # Test reports was always captured, so this action uses "always()" condition - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 if: always() with: name: cypress-results