Skip to content

CI fix for Code generator #283

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 47 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a22d8c9
Fix tests for CI
guptaaryan16 Aug 1, 2023
19132b7
Update ci.yml
guptaaryan16 Aug 1, 2023
577b083
Add some test fixes
guptaaryan16 Aug 2, 2023
ea57f84
Revert "Add some test fixes"
guptaaryan16 Aug 2, 2023
204adcf
Changed tests
guptaaryan16 Aug 3, 2023
4e2cea4
Revert "Changed tests"
guptaaryan16 Aug 3, 2023
c0eb396
Last try to fix flaky tests
guptaaryan16 Aug 3, 2023
d7d10cc
Fix tests
guptaaryan16 Aug 3, 2023
6d0c730
fix tests
guptaaryan16 Aug 3, 2023
1686505
Changed tests
guptaaryan16 Aug 3, 2023
f5f6844
Add test fix for vis-gans
guptaaryan16 Aug 3, 2023
05e1a7f
fix tests
guptaaryan16 Aug 3, 2023
8edbf29
changed the file
guptaaryan16 Aug 3, 2023
d6d8301
fix tests
guptaaryan16 Aug 3, 2023
805eac3
check the test
guptaaryan16 Aug 3, 2023
387515e
changed the vis-dcgan tests
guptaaryan16 Aug 3, 2023
ab605e8
fixed tests
guptaaryan16 Aug 3, 2023
730f868
revert ci.yaml changes
guptaaryan16 Aug 3, 2023
e1e7f03
Chages in tests
guptaaryan16 Aug 3, 2023
621e2af
Added 10 retries for each test to fix CI
guptaaryan16 Aug 3, 2023
1d168fa
Revert "Added 10 retries for each test to fix CI"
guptaaryan16 Aug 3, 2023
d36346f
Revert "Chages in tests"
guptaaryan16 Aug 3, 2023
00cd4c4
changed tests
guptaaryan16 Aug 3, 2023
4d81f52
2 catch calls only for dealing with failing waitForDownload event
guptaaryan16 Aug 7, 2023
3cfd895
Adding click on code button line in catch calls for failing tests
guptaaryan16 Aug 7, 2023
69f5eb7
Make catch calls in test functions async
guptaaryan16 Aug 7, 2023
ec3b638
fix fmt
guptaaryan16 Aug 7, 2023
a52bb27
Fix await calls
guptaaryan16 Aug 7, 2023
6ba8c75
Change the formatting of the .catch function in tests
guptaaryan16 Aug 7, 2023
b5682b3
Revert "2 catch calls only for dealing with failing waitForDownload e…
guptaaryan16 Aug 7, 2023
5641169
Added code button click condition for the .catch calls
guptaaryan16 Aug 7, 2023
7ef2f70
Wait time to 3000ms
guptaaryan16 Aug 7, 2023
71b7e4f
removed .catch functions
guptaaryan16 Aug 7, 2023
a3b79c2
Changed the click button to hover option in the Code option
guptaaryan16 Aug 7, 2023
644e46a
fmt fix
guptaaryan16 Aug 7, 2023
bcfe5e0
fix tests by reverting changes to 00cd4c4
guptaaryan16 Aug 8, 2023
8a41d52
changed the click to hover
guptaaryan16 Aug 8, 2023
b62cc26
Added hover for the wget text box in tests
guptaaryan16 Aug 9, 2023
a9733a0
fix fmt
guptaaryan16 Aug 9, 2023
2cd663c
Fix the tests by adding 2nd catch method
guptaaryan16 Aug 9, 2023
fb86284
make .catch functions sync for tests
guptaaryan16 Aug 9, 2023
3b505fa
fix tests for now with e1e7f03 commit
guptaaryan16 Aug 9, 2023
8629ad3
Test only one suit (to decrease the time in CI)
guptaaryan16 Aug 9, 2023
c62ba8d
Revert "Test only one suit (to decrease the time in CI)"
guptaaryan16 Aug 9, 2023
2295a14
Fix tests like before
guptaaryan16 Aug 9, 2023
9869757
Add comments for CI changes for now
guptaaryan16 Aug 10, 2023
079d20a
fix typo
guptaaryan16 Aug 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 52 additions & 10 deletions __tests__/text-classification.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,25 @@ test('text classification simple', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
// TODO: simplify the downloadPromise calls
// Here we are trying to wait for 2 seconds before clicking on the `Code` and `Download Zip` button
const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
Copy link
Member

Choose a reason for hiding this comment

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

I do not understand why you do not call

page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()

before download promise:

  const downloadPromise = await page
    .waitForEvent('download', { timeout: 2000 })

?

It does not seem correct to reclick 3 times in catch

page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
// these catch calls are required to make sure if CI fails initially then we can have something to rely for further tests
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})

await downloadPromise.saveAs('./dist-tests/text-classification-simple.zip')
Expand Down Expand Up @@ -88,12 +101,22 @@ test('text classification all', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
await downloadPromise.saveAs('./dist-tests/text-classification-all.zip')
})
Expand All @@ -112,14 +135,24 @@ test('text classification launch', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
await page.getByRole('button', { name: 'Download Zip' }).click()
const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})

await downloadPromise.saveAs('./dist-tests/text-classification-launch.zip')
})

Expand All @@ -138,13 +171,22 @@ test('text classification spawn', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
await page.getByRole('button', { name: 'Download Zip' }).click()
const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
await downloadPromise.saveAs('./dist-tests/text-classification-spawn.zip')
})
64 changes: 51 additions & 13 deletions __tests__/vision-classification.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,25 @@ test('vision classification simple', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
await page.getByRole('button', { name: 'Download Zip' }).click()

// TODO: simplify the downloadPromise calls
// Here we are trying to wait for 2 seconds before clicking on the `Code` and `Download Zip` button
const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
// these catch calls are required to make sure if CI fails initially then we can have something to rely for further tests
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})

await downloadPromise.saveAs('./dist-tests/vision-classification-simple.zip')
Expand Down Expand Up @@ -90,13 +101,22 @@ test('vision classification all', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
await page.getByRole('button', { name: 'Download Zip' }).click()
const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
await downloadPromise.saveAs('./dist-tests/vision-classification-all.zip')
})
Expand All @@ -115,13 +135,22 @@ test('vision classification launch', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
await page.getByRole('button', { name: 'Download Zip' }).click()
const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
await downloadPromise.saveAs('./dist-tests/vision-classification-launch.zip')
})
Expand All @@ -141,13 +170,22 @@ test('vision classification spawn', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
await page.getByRole('button', { name: 'Download Zip' }).click()
const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
await downloadPromise.saveAs('./dist-tests/vision-classification-spawn.zip')
})
69 changes: 51 additions & 18 deletions __tests__/vision-dcgan.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,25 @@ test('vision dcgan simple', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
await page.getByRole('button', { name: 'Download Zip' }).click()

// TODO: simplify the downloadPromise calls
// Here we are trying to wait for 2 seconds before clicking on the `Code` and `Download Zip` button
const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
// these catch calls are required to make sure if CI fails initially then we can have something to rely for further tests
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
await downloadPromise.saveAs('./dist-tests/vision-dcgan-simple.zip')
})
Expand Down Expand Up @@ -89,16 +100,23 @@ test('vision dcgan all', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
await page.getByRole('button', { name: 'Download Zip' }).click()

const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})

await downloadPromise.saveAs('./dist-tests/vision-dcgan-all.zip')
})

Expand All @@ -116,16 +134,23 @@ test('vision dcgan launch', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
await page.getByRole('button', { name: 'Download Zip' }).click()

const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})

await downloadPromise.saveAs('./dist-tests/vision-dcgan-launch.zip')
})

Expand All @@ -144,14 +169,22 @@ test('vision dcgan spawn', async () => {
await page.click('text=Loggers')
await page.click('text=config.yaml')

await page.getByRole('button', { name: 'Code' }).click()
await page.getByRole('button', { name: 'Download Zip' }).click()

const downloadPromise = await page
.waitForEvent('download', { timeout: 2000 })
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download', { timeout: 2000 })
})
.catch(() => {
page.getByRole('button', { name: 'Code' }).click()
page.getByRole('button', { name: 'Download Zip' }).click()
return page.waitForEvent('download')
return page.waitForEvent('download', { timeout: 2000 })
})
await downloadPromise.saveAs('./dist-tests/vision-dcgan-spawn.zip')
})
Loading