Skip to content

Commit

Permalink
fix(ci): reduce flakiness in add_users, siblings smoke test (#6883)
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal committed Dec 29, 2022
1 parent 5755d2c commit 0bbe6d6
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 37 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/docker-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.0 &
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 &
- name: Install dependencies
run: ./metadata-ingestion/scripts/install_deps.sh
- name: Build datahub cli
Expand Down Expand Up @@ -521,23 +513,25 @@ 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
id: cache-venv
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
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
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ services:
args:
APP_ENV: dev
depends_on:
- broker:
- schema-registry:
- broker
- schema-registry

datahub-gms:
image: linkedin/datahub-gms:debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
})
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
22 changes: 5 additions & 17 deletions smoke-test/tests/cypress/cypress/integration/siblings/siblings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
});
Expand All @@ -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');
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion smoke-test/tests/cypress/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
})
Expand Down
2 changes: 1 addition & 1 deletion smoke-test/tests/cypress/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0bbe6d6

Please sign in to comment.