Skip to content

[db] Add extra assertions to workspace cluster db tests #14323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

andrew-farries
Copy link
Contributor

Description

Add stronger assertions to the the database tests for the workspace cluster db.

Now that the primary key for the table is a composite of (name, applicationCluster), add tests that operations work as expected with rows that share the same name.

Related Issue(s)

Part of #14136

How to test

unit tests

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

@andrew-farries andrew-farries requested a review from a team November 1, 2022 12:54
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Nov 1, 2022
Copy link
Member

@easyCZ easyCZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

/hold for Q

Comment on lines 203 to 209
const wscs2 = await this.db.findFiltered({ applicationCluster: "us02" });
expect(wscs2.length).to.equal(2);
wscs2.sort((x, y) => x.name.localeCompare(y.name));
expect(wscs2[0].name).to.equal("eu71");
expect(wscs2[0].applicationCluster).to.equal("us02");
expect(wscs2[1].name).to.equal("us71");
expect(wscs2[1].applicationCluster).to.equal("us02");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not possible to compare lists directly? That would avoid comparing field-by-field which has the risk of still passing when new fields are added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to change the style of assertions here.

@andrew-farries andrew-farries force-pushed the af/extra-assertions-for-ws-cluster-db branch from f2cfc62 to 4def1c3 Compare November 1, 2022 16:04
@roboquat roboquat added size/L and removed size/M labels Nov 1, 2022
@roboquat roboquat merged commit 19c0a6d into main Nov 1, 2022
@roboquat roboquat deleted the af/extra-assertions-for-ws-cluster-db branch November 1, 2022 16:36
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants