From f33deedc6ec79f20a73e0e783b62fe7a52041602 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Thu, 29 Dec 2022 16:01:13 +0530 Subject: [PATCH 1/8] reduce flakiness in add_users, siblings --- docker/docker-compose.dev.yml | 4 ++-- .../integration/mutations/add_users.js | 3 ++- .../cypress/integration/siblings/siblings.js | 22 +++++-------------- .../tests/cypress/cypress/support/commands.js | 2 +- 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 1f4101bca0e8fe..cbf0099f9b9cd6 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -32,8 +32,8 @@ services: args: APP_ENV: dev depends_on: - - broker: - - schema-registry: + - broker + - schema-registry datahub-gms: image: linkedin/datahub-gms:debug diff --git a/smoke-test/tests/cypress/cypress/integration/mutations/add_users.js b/smoke-test/tests/cypress/cypress/integration/mutations/add_users.js index 7dea5ba01d5d59..746166d5475d6b 100644 --- a/smoke-test/tests/cypress/cypress/integration/mutations/add_users.js +++ b/smoke-test/tests/cypress/cypress/integration/mutations/add_users.js @@ -22,8 +22,9 @@ describe("add_user", () => { cy.clickOptionWithText("Invite Users") - cy.waitTextVisible('signup?invite_token').then(($elem) => { + cy.waitTextVisible(/signup\?invite_token=\w+/).then(($elem) => { const inviteLink = $elem.text(); + cy.log(inviteLink); cy.logout(); cy.visit(inviteLink); let name = tryToSignUp(); diff --git a/smoke-test/tests/cypress/cypress/integration/siblings/siblings.js b/smoke-test/tests/cypress/cypress/integration/siblings/siblings.js index 97f960a6887c0f..74832b8f69dcbd 100644 --- a/smoke-test/tests/cypress/cypress/integration/siblings/siblings.js +++ b/smoke-test/tests/cypress/cypress/integration/siblings/siblings.js @@ -43,7 +43,7 @@ describe('siblings', () => { cy.visit('/dataset/urn:li:dataset:(urn:li:dataPlatform:dbt,cypress_project.jaffle_shop.customers,PROD)/?is_lineage_mode=false'); // navigate to the bq entity - cy.get('[data-testid="compact-entity-link-urn:li:dataset:(urn:li:dataPlatform:bigquery,cypress_project.jaffle_shop.customers,PROD)"]').click({ force: true }); + cy.clickOptionWithTestId('compact-entity-link-urn:li:dataset:(urn:li:dataPlatform:bigquery,cypress_project.jaffle_shop.customers,PROD)'); // check merged platforms is not shown cy.get('[data-testid="entity-header-test-id"]').contains('dbt & BigQuery').should('not.exist'); @@ -62,16 +62,16 @@ describe('siblings', () => { cy.visit('/dataset/urn:li:dataset:(urn:li:dataPlatform:dbt,cypress_project.jaffle_shop.customers,PROD)/?is_lineage_mode=false'); // navigate to the bq entity - cy.get('[data-testid="compact-entity-link-urn:li:dataset:(urn:li:dataPlatform:bigquery,cypress_project.jaffle_shop.customers,PROD)"]').click({ force: true }); + cy.clickOptionWithTestId('compact-entity-link-urn:li:dataset:(urn:li:dataPlatform:bigquery,cypress_project.jaffle_shop.customers,PROD)'); - cy.contains('Add Term').click(); + cy.clickOptionWithText('Add Term'); cy.selectOptionInTagTermModal('CypressTerm'); cy.visit('/dataset/urn:li:dataset:(urn:li:dataPlatform:dbt,cypress_project.jaffle_shop.customers,PROD)/?is_lineage_mode=false'); cy.get('a[href="/glossaryTerm/urn:li:glossaryTerm:CypressNode.CypressTerm"]').within(() => cy.get('span[aria-label=close]').click()); - cy.contains('Yes').click(); + cy.clickOptionWithText('Yes'); cy.contains('CypressTerm').should('not.exist'); }); @@ -88,18 +88,6 @@ describe('siblings', () => { cy.get('.test-search-result-sibling-section').get('.test-mini-preview-class:contains(raw_orders)').should('have.length', 2); }); - it('will combine results in search', () => { - cy.login(); - cy.visit('/search?page=1&query=%2522raw_orders%2522'); - - cy.contains('Showing 1 - 2 of 2 results'); - - cy.get('.test-search-result').should('have.length', 1); - cy.get('.test-search-result-sibling-section').should('have.length', 1); - - cy.get('.test-search-result-sibling-section').get('.test-mini-preview-class:contains(raw_orders)').should('have.length', 2); - }); - it('will combine results in lineage', () => { cy.login(); cy.visit('dataset/urn:li:dataset:(urn:li:dataPlatform:dbt,cypress_project.jaffle_shop.stg_orders,PROD)/?is_lineage_mode=true'); @@ -122,7 +110,7 @@ describe('siblings', () => { cy.login(); cy.visit('dataset/urn:li:dataset:(urn:li:dataPlatform:dbt,cypress_project.jaffle_shop.stg_orders,PROD)/?is_lineage_mode=true'); - cy.get('[data-testid="compress-lineage-toggle"]').click({ force: true }); + cy.clickOptionWithTestId('compress-lineage-toggle'); // check the subtypes cy.get('text:contains(View)').should('have.length', 2); diff --git a/smoke-test/tests/cypress/cypress/support/commands.js b/smoke-test/tests/cypress/cypress/support/commands.js index ea6fe5242d617d..29a0d0c29add88 100644 --- a/smoke-test/tests/cypress/cypress/support/commands.js +++ b/smoke-test/tests/cypress/cypress/support/commands.js @@ -157,7 +157,7 @@ Cypress.Commands.add("enterTextInTestId", (id, text) => { }) Cypress.Commands.add("clickOptionWithTestId", (id) => { - cy.get(selectorWithtestId(id)).click({ + cy.get(selectorWithtestId(id)).first().click({ force: true, }); }) From 11a72a4233ddc569df2b3c9ca1bbc7544e5db61a Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Thu, 29 Dec 2022 16:40:51 +0530 Subject: [PATCH 2/8] modify analytics test for tracking to be sent --- .../tests/cypress/cypress/integration/analytics/analytics.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/smoke-test/tests/cypress/cypress/integration/analytics/analytics.js b/smoke-test/tests/cypress/cypress/integration/analytics/analytics.js index ed07233d754509..0b8d1c443975d3 100644 --- a/smoke-test/tests/cypress/cypress/integration/analytics/analytics.js +++ b/smoke-test/tests/cypress/cypress/integration/analytics/analytics.js @@ -5,13 +5,12 @@ describe('analytics', () => { cy.goToChart("urn:li:chart:(looker,cypress_baz1)"); cy.waitTextVisible("Baz Chart 1"); cy.openEntityTab("Dashboards"); + cy.wait(1000); cy.goToAnalytics(); - cy.wait(1000); cy.contains("Section Views across Entity Types").scrollIntoView({ ensureScrollable: false }) - cy.wait(1000); cy.waitTextPresent("dashboards"); }); }) From d6e07cadaf819fe8827129a454589d565cbc2137 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Thu, 29 Dec 2022 17:23:00 +0530 Subject: [PATCH 3/8] update versions pulled in background --- .github/workflows/docker-unified.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-unified.yml b/.github/workflows/docker-unified.yml index ed6a0bbd67eb5a..0ed579e1ddfa30 100644 --- a/.github/workflows/docker-unified.yml +++ b/.github/workflows/docker-unified.yml @@ -470,11 +470,11 @@ jobs: - name: Pull images in background run: | docker pull acryldata/datahub-actions:head & - docker pull confluentinc/cp-kafka:7.2.0 & + docker pull confluentinc/cp-kafka:7.2.2 & docker pull elasticsearch:7.9.3 & docker pull mariadb:10.5.8 & docker pull confluentinc/cp-schema-registry:7.2.0 & - docker pull confluentinc/cp-zookeeper:7.2.0 & + docker pull confluentinc/cp-zookeeper:7.2.2 & - name: Install dependencies run: ./metadata-ingestion/scripts/install_deps.sh - name: Build datahub cli From 890785c0abda14aff6f14eb11718acb351914ce3 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Thu, 29 Dec 2022 18:15:37 +0530 Subject: [PATCH 4/8] fix problem with venv caching - wrong path --- .github/workflows/docker-unified.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-unified.yml b/.github/workflows/docker-unified.yml index 0ed579e1ddfa30..f0096a0de2a231 100644 --- a/.github/workflows/docker-unified.yml +++ b/.github/workflows/docker-unified.yml @@ -521,7 +521,7 @@ jobs: pip install pip -U # only 22.2 and above contains the --dry-run flag # only the last line of the output is the packages that will be installed - pip install --dry-run -r ./smoke/requirements.txt | tail -n 1 > /tmp/would_be_installed.txt + pip install --dry-run -r ./smoke-test/requirements.txt | tail -n 1 > /tmp/would_be_installed.txt CHECKSUM=$(shasum /tmp/would_be_installed.txt | awk '{print $1}') echo "packages_checksum=$CHECKSUM" >> $GITHUB_OUTPUT - uses: actions/cache@v3 From 7d6841b33a4dee6dca944b2e6d737aa4dde705e6 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Thu, 29 Dec 2022 19:39:03 +0530 Subject: [PATCH 5/8] add 60s sleep --- .github/workflows/docker-unified.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/docker-unified.yml b/.github/workflows/docker-unified.yml index f0096a0de2a231..54b054499ebc91 100644 --- a/.github/workflows/docker-unified.yml +++ b/.github/workflows/docker-unified.yml @@ -538,6 +538,11 @@ jobs: DATAHUB_VERSION: ${{ needs.setup.outputs.unique_tag }} run: | ./smoke-test/run-quickstart.sh + - name: sleep 60s + run: | + # we are doing this because gms takes time to get ready + # and we don't have a better readiness check when bootstrap is done + sleep 60s - name: Smoke test env: RUN_QUICKSTART: false From c839dfcafab6979f743cdba7fa058fb9cbce5056 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Thu, 29 Dec 2022 19:40:58 +0530 Subject: [PATCH 6/8] add test less flaky --- smoke-test/tests/managed-ingestion/managed_ingestion_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smoke-test/tests/managed-ingestion/managed_ingestion_test.py b/smoke-test/tests/managed-ingestion/managed_ingestion_test.py index 7367118c69d0f5..d80b56b8cfcfb4 100644 --- a/smoke-test/tests/managed-ingestion/managed_ingestion_test.py +++ b/smoke-test/tests/managed-ingestion/managed_ingestion_test.py @@ -160,7 +160,7 @@ def _ensure_ingestion_source_present( if num_execs is not None: ingestion_source = res_data["data"]["ingestionSource"] - assert ingestion_source["executions"]["total"] == num_execs + assert ingestion_source["executions"]["total"] > num_execs return res_data From 33bc1a2799b493b2609417e348895e0b72a4f744 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Thu, 29 Dec 2022 20:45:19 +0530 Subject: [PATCH 7/8] remove pre-fetch of images --- .github/workflows/docker-unified.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/docker-unified.yml b/.github/workflows/docker-unified.yml index 54b054499ebc91..5dd488e24d78f7 100644 --- a/.github/workflows/docker-unified.yml +++ b/.github/workflows/docker-unified.yml @@ -467,14 +467,6 @@ jobs: with: python-version: "3.7" cache: 'pip' - - name: Pull images in background - run: | - docker pull acryldata/datahub-actions:head & - docker pull confluentinc/cp-kafka:7.2.2 & - docker pull elasticsearch:7.9.3 & - docker pull mariadb:10.5.8 & - docker pull confluentinc/cp-schema-registry:7.2.0 & - docker pull confluentinc/cp-zookeeper:7.2.2 & - name: Install dependencies run: ./metadata-ingestion/scripts/install_deps.sh - name: Build datahub cli @@ -529,9 +521,6 @@ jobs: with: path: ./smoke-test/venv/ key: smoke-venv-${{ runner.os }}-${{ steps.packages_checksum.outputs.packages_checksum }} - - name: check background image download status - run: | - jobs - name: run quickstart env: DATAHUB_TELEMETRY_ENABLED: false From d352887d3accd15549a902bcfdd7ce2a48a213b3 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Thu, 29 Dec 2022 21:42:22 +0530 Subject: [PATCH 8/8] fix check for cypress key --- smoke-test/tests/cypress/integration_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smoke-test/tests/cypress/integration_test.py b/smoke-test/tests/cypress/integration_test.py index 8678323bc92d09..c522b8b4c78fda 100644 --- a/smoke-test/tests/cypress/integration_test.py +++ b/smoke-test/tests/cypress/integration_test.py @@ -153,7 +153,7 @@ def test_run_cypress(frontend_session, wait_for_healthchecks): record_key = os.getenv("CYPRESS_RECORD_KEY") tag_arg = "" test_strategy = os.getenv("TEST_STRATEGY", None) - if record_key is not None: + if record_key: record_arg = " --record " tag_arg = f" --tag {test_strategy} " else: