-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5645 from gooddata/pb-minor-fixes
fix: e2e tests from pr improvements
- Loading branch information
Showing
5 changed files
with
62 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ on: | |
required: false | ||
description: "List of spec files to filter" | ||
type: string | ||
source-ref: | ||
required: false | ||
description: "source ref of the current code" | ||
type: string | ||
|
||
jobs: | ||
warm-up-cache: | ||
|
@@ -14,6 +18,9 @@ jobs: | |
labels: runners-cxa-xlarge | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.source-ref }} | ||
fetch-depth: 2 | ||
- name: Git config user | ||
uses: snow-actions/[email protected] | ||
with: | ||
|
@@ -31,6 +38,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.source-ref }} | ||
fetch-depth: 2 | ||
- name: Git config user | ||
uses: snow-actions/[email protected] | ||
|
@@ -54,6 +62,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.source-ref }} | ||
fetch-depth: 2 | ||
- name: Git config user | ||
uses: snow-actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ on: | |
required: false | ||
description: "List of spec files to filter" | ||
type: string | ||
source-ref: | ||
required: false | ||
description: "source ref of the current code" | ||
type: string | ||
|
||
jobs: | ||
warm-up-cache: | ||
|
@@ -14,6 +18,10 @@ jobs: | |
labels: runners-cxa-xlarge | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.source-ref }} | ||
fetch-depth: 2 | ||
|
||
- name: Git config user | ||
uses: snow-actions/[email protected] | ||
with: | ||
|
@@ -31,6 +39,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.source-ref }} | ||
fetch-depth: 2 | ||
- name: Git config user | ||
uses: snow-actions/[email protected] | ||
|
@@ -91,6 +100,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.source-ref }} | ||
fetch-depth: 2 | ||
- name: Git config user | ||
uses: snow-actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
libs/sdk-ui-tests-e2e/cypress/plugins/removePassingTestVideos.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// (C) 2021-2024 GoodData Corporation | ||
import { unlink } from "fs"; | ||
import { promisify } from "util"; | ||
|
||
const rm = promisify(unlink); | ||
|
||
export default ((on, _config) => { | ||
const filesToDelete: string[] = []; | ||
on("after:spec", (_spec, results) => { | ||
if (results.stats.failures === 0 && results.video) { | ||
filesToDelete.push(results.video); | ||
} | ||
}); | ||
on("after:run", async () => { | ||
// eslint-disable-next-line no-console | ||
console.log("Deleting %d videos from successful specs", filesToDelete.length); | ||
await Promise.all(filesToDelete.map((videoFile) => rm(videoFile))); | ||
}); | ||
}) as Cypress.PluginConfig; |