-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
🪟 🧪 E2E Tests for auto-detect schema changes #20682
Conversation
* Converts Cypress chain to regular Promise. | ||
*/ | ||
export const toPromise = <T>(chain: Cypress.Chainable<T>): Promise<T> => { | ||
return new Cypress.Promise((resolve, reject) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return new Cypress.Promise((resolve, reject) => { | |
return new Cypress.Promise<T>((resolve, reject) => { |
|
||
export const clickSchemaChangesReviewButton = () => { | ||
cy.get(schemaChangesReviewButton).click(); | ||
// cy.get(schemaChangesReviewButton).should("be.disabled"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why commented?
We need to enable the new table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was related to not disabling the button in the loading state, which is fixed in #20737
4924ed9
to
11a25db
Compare
export const createTable = (tableName: string, columns: string[]): string => | ||
`CREATE TABLE ${tableName}(${columns.join(", ")});`; | ||
|
||
export const dropTable = (tableName: string) => `DROP TABLE IF EXISTS ${tableName}`; | ||
|
||
export const alterTable = (tableName: string, params: { add?: string[]; drop?: string[] }): string => { | ||
const adds = params.add ? params.add.map((add) => `ADD COLUMN ${add}`) : []; | ||
const drops = params.drop ? params.drop.map((columnName) => `DROP COLUMN ${columnName}`) : []; | ||
const alterations = [...adds, ...drops]; | ||
|
||
return `ALTER TABLE ${tableName} ${alterations.join(", ")};`; | ||
}; | ||
|
||
export const insertIntoTable = (tableName: string, valuesByColumn: Record<string, unknown>): string => { | ||
const keys = Object.keys(valuesByColumn); | ||
const values = keys | ||
.map((key) => valuesByColumn[key]) | ||
.map((value) => (typeof value === "string" ? `'${value}'` : value)); | ||
|
||
return `INSERT INTO ${tableName}(${keys.join(", ")}) VALUES(${values.join(", ")});`; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
11a25db
to
b80b47c
Compare
* Update db queries with generator functions * Update users table to include better columns and cursor * Add name to ResetWarningModalSwitch * Add test ID to review button in SchemaChangesDetected modal
…n the schema change type
…for non-breaking changes
45467f1
to
e06f4f5
Compare
… records to users table
@dizel852 this is currently not compatible with the new table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested locally with old stream table - works like a charm 👍
Can't wait to start using the new test API 🔥
* master: (86 commits) Discover worker starts to use API to write schema result (#21875) 🪟 🎉 Connector Builder Landing Page (#22122) Fix pnpm cache path (#22418) Add additional shorter setup guides (#22318) Source Amazon Ads: fix reports stream records primary keys (#21677) Connector acceptance test: Fix discovered catalog caching for different configs (#22301) 🪟🐛 Make modal scrollable (#21973) only compute diff if the schema discovery actually succeeded (#22377) Source Klaviyo: fix schema (#22071) 🪟 🔧 Switch to `pnpm` for package managing (#22053) Source Sentry: turn on default availability strategy (#22303) Source freshdesk: deduplicate table names (#22164) Update connector-acceptance-tests-reference.md (#22370) Update the default security groups for the EC2 runner (#22347) Trace refresh schema operations (#22326) Remove manual docker upgrades from workflows (#22344) Update CODEOWNERS for connector acceptance tests to connector ops (#22341) 🐛 source: airtable - handle singleSelect types (#22311) Source tiktok: chunk advertiser IDs (#22309) 🪟 🧪 E2E Tests for auto-detect schema changes (#20682) ...
* master: (24 commits) Discover worker starts to use API to write schema result (#21875) 🪟 🎉 Connector Builder Landing Page (#22122) Fix pnpm cache path (#22418) Add additional shorter setup guides (#22318) Source Amazon Ads: fix reports stream records primary keys (#21677) Connector acceptance test: Fix discovered catalog caching for different configs (#22301) 🪟🐛 Make modal scrollable (#21973) only compute diff if the schema discovery actually succeeded (#22377) Source Klaviyo: fix schema (#22071) 🪟 🔧 Switch to `pnpm` for package managing (#22053) Source Sentry: turn on default availability strategy (#22303) Source freshdesk: deduplicate table names (#22164) Update connector-acceptance-tests-reference.md (#22370) Update the default security groups for the EC2 runner (#22347) Trace refresh schema operations (#22326) Remove manual docker upgrades from workflows (#22344) Update CODEOWNERS for connector acceptance tests to connector ops (#22341) 🐛 source: airtable - handle singleSelect types (#22311) Source tiktok: chunk advertiser IDs (#22309) 🪟 🧪 E2E Tests for auto-detect schema changes (#20682) ...
What
Closes #17936
Adds E2E tests for auto-detect schema changes:
To make this possible, there were a few additions to the cypress framework: