Skip to content

Commit

Permalink
Don't run cleanup hook in CI
Browse files Browse the repository at this point in the history
Cleanup is not relevant in CI since the container does not live past the tests.
  • Loading branch information
nas-tabchiche committed Sep 17, 2024
1 parent a97b395 commit fae7cb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ jobs:
- name: Run tests with browser ${{ matrix.playwright-browser }}
working-directory: ${{ env.frontend-directory }}
run: npx playwright test --project=${{ matrix.playwright-browser }}
env:
CI: true
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down Expand Up @@ -196,6 +198,8 @@ jobs:
- name: Run tests with browser ${{ matrix.playwright-browser }}
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: npx playwright test --project=${{ matrix.playwright-browser }}
env:
CI: true
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
8 changes: 6 additions & 2 deletions frontend/tests/functional/user-permissions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Object.entries(userGroups).forEach(([userGroup, userGroupData]) => {
test.describe(`${userGroupData.name} user has the right permissions`, async () => {
test.describe.configure({ mode: 'serial' });

let vars = TestContent.generateTestVars();
let testObjectsData: { [k: string]: any } = TestContent.itemBuilder(vars);
const vars = TestContent.generateTestVars();
const testObjectsData: { [k: string]: any } = TestContent.itemBuilder(vars);

test.beforeEach(async ({ page }) => {
setHttpResponsesListener(page);
Expand Down Expand Up @@ -212,6 +212,10 @@ Object.entries(userGroups).forEach(([userGroup, userGroupData]) => {
});

test.afterAll('cleanup', async ({ browser }) => {
if (process.env.CI) {
// Don't cleanup in CI
return true;
}
const page = await browser.newPage();
const loginPage = new LoginPage(page);
const usersPage = new PageContent(page, '/users', 'Users');
Expand Down

0 comments on commit fae7cb2

Please sign in to comment.