Skip to content

Commit

Permalink
Only map video folder for e2e when ARTIFACTS variable is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanGreene committed Sep 19, 2022
1 parent ebfcea1 commit d96d0f9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
2 changes: 2 additions & 0 deletions packages/e2e/cypress/e2e/common/about.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ describe('About page', () => {

cy.contains('#tkn--about--triggers-tile', triggersNamespace);
cy.contains('#tkn--about--triggers-tile', triggersVersion);

expect(true).to.eq(false);
});
});
26 changes: 17 additions & 9 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,23 @@ test_dashboard() {
fi

echo "Running browser E2E tests…"
VIDEO_PATH=$ARTIFACTS/videos
mkdir -p $VIDEO_PATH
chmod -R 777 $VIDEO_PATH
# In case of failure we'll upload videos of the failing tests
# Our Cypress config will delete videos of passing tests before exiting
docker run --rm --network=host -v $VIDEO_PATH:/home/node/cypress/videos dashboard-e2e || fail_test "Browser E2E tests failed"

# If we get here the tests passed, no need to upload artifacts
rm -rf $VIDEO_PATH
CAPTURE_VIDEO=""
if [ -z "$ARTIFACTS" ]; then
VIDEO_PATH=$ARTIFACTS/videos
mkdir -p $VIDEO_PATH
chmod -R 777 $VIDEO_PATH
# In case of failure we'll upload videos of the failing tests
# Our Cypress config will delete videos of passing tests before exiting
CAPTURE_VIDEO="-v $VIDEO_PATH:/home/node/cypress/videos"
fi

docker run --rm --network=host $CAPTURE_VIDEO dashboard-e2e || fail_test "Browser E2E tests failed"

if [ -z "$VIDEO_PATH" ]; then
# If we get here the tests passed, no need to upload artifacts
rm -rf $VIDEO_PATH
fi

kill -9 $dashboardForwardPID

$tekton_repo_dir/scripts/installer uninstall ${@:2}
Expand Down

0 comments on commit d96d0f9

Please sign in to comment.