Skip to content

Commit

Permalink
update e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
shwet2407 committed Nov 13, 2024
1 parent d5c55c2 commit 0d067ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 70 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/~reusable_e2e_all_OS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ jobs:
OS: ${{ matrix.os }}
BRANCH: main
NPM_IGNORE_PREFIX: ${{ vars.NPM_IGNORE_PREFIX }}
PACKAGE_VERSION: latest
FLEX_UI_VERSION: latest
PACKAGE_VERSION: ${{ vars.PACKAGE_VERSION }}
FLEX_UI_VERSION: ${{ vars.FLEX_UI_VERSION }}
SEND_NOTIFICATION: ${{ inputs.SEND_NOTIFICATION }}
secrets:
CONSOLE_EMAIL: ${{ secrets.CONSOLE_EMAIL }}
Expand Down
77 changes: 9 additions & 68 deletions .github/workflows/~reusable_e2e_by_OS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,48 +143,22 @@ jobs:
env:
TS: 0
run: |
echo "Starting e2e tests with a 90-minute timeout"
cd packages/flex-plugin-e2e-tests
for i in 1 2; do # Retry logic, retry 3 times
timeout 90m npm run start && break || echo "E2E tests timed out, retrying ($i/3)..."
done
npm run start
- name: Run e2e tests - JS (Macos)
if: ${{ inputs.OS == 'macos-latest' }}
env:
TS: 0
run: |
echo "Starting e2e tests with a 90-minute timeout"
cd packages/flex-plugin-e2e-tests
for i in 1 2; do # Retry logic, retry 3 times
gtimeout 90m npm run start && break || echo "E2E tests timed out, retrying ($i/3)..."
done
npm run start
- name: Run e2e tests - JS (Windows)
if: ${{ inputs.OS == 'windows-latest' }}
env:
TS: 0
run: |
echo "Starting e2e tests with a 90-minute timeout"
$attempts = 2
$timeout = 5400000 # 90 minutes in milliseconds
cd packages/flex-plugin-e2e-tests
for ($i=1; $i -le $attempts; $i++) {
try {
$process = Start-Process -FilePath 'npm' -ArgumentList 'run start' -NoNewWindow -PassThru
if ($process.WaitForExit($timeout)) {
echo 'E2E tests completed successfully'
exit 0
} else {
echo 'E2E tests timed out. Retrying...'
Stop-Process -Id $process.Id
}
} catch {
echo 'E2E tests failed.'
if ($i -eq $attempts) {
throw 'E2E tests failed after 3 retries.'
}
}
}
shell: pwsh
cd packages/flex-plugin-e2e-tests
npm run start
- name: Kill node for Windows os
if: ${{ inputs.OS == 'windows-latest' }}
run: |
Expand All @@ -195,55 +169,22 @@ jobs:
env:
TS: 1
run: |
echo "Starting e2e tests with a 90-minute timeout"
cd packages/flex-plugin-e2e-tests
for i in 1 2; do # Retry logic, retry 3 times
timeout 90m npm run start && break || echo "E2E tests timed out, retrying ($i/3)..."
done
npm run start
- name: Run e2e tests - TS (Macos)
if: ${{ inputs.OS == 'macos-latest' }}
env:
TS: 1
run: |
echo "Starting e2e tests with a 90-minute timeout"
cd packages/flex-plugin-e2e-tests
for i in 1 2; do # Retry logic, retry 3 times
gtimeout 90m npm run start && break || echo "E2E tests timed out, retrying ($i/3)..."
done
cd packages/flex-plugin-e2e-tests
npm run start
- name: Run e2e tests - TS (Windows)
if: ${{ inputs.OS == 'windows-latest' }}
env:
TS: 1
run: |
echo "Starting e2e tests with a 90-minute timeout"
$attempts = 2
$timeout = 5400000 # 90 minutes in milliseconds
cd packages/flex-plugin-e2e-tests
for ($i=1; $i -le $attempts; $i++) {
try {
$process = Start-Process -FilePath 'npm' -ArgumentList 'run start' -NoNewWindow -PassThru
if ($process.WaitForExit($timeout)) {
if ($process.ExitCode -eq 0) {
echo 'E2E tests completed successfully'
exit 0
} else {
echo "E2E tests failed with exit code $($process.ExitCode). Retrying..."
Stop-Process -Id $process.Id
taskkill /f /im node.exe
}
} else {
echo 'E2E tests timed out. Retrying...'
Stop-Process -Id $process.Id
taskkill /f /im node.exe
}
} catch {
echo 'E2E tests failed.'
if ($i -eq $attempts) {
throw 'E2E tests failed after 3 retries.'
}
}
}
shell: pwsh
cd packages/flex-plugin-e2e-tests
npm run start
- name: Upload Screenshots
uses: actions/upload-artifact@v3
if: always()
Expand Down

0 comments on commit 0d067ba

Please sign in to comment.