Skip to content

Commit

Permalink
Testing artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner-ricks committed Nov 21, 2024
1 parent 5995da8 commit 413af0a
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 56 deletions.
96 changes: 48 additions & 48 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,37 +114,37 @@ jobs:
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Frontend
uses: ./sbl-frontend/.github/actions/build-image
with:
rootDir: sbl-frontend
localImage: sbl-project-sbl-frontend
# remoteImage: ghcr.io/cfpb/regtech/sbl/sbl-frontend
# remoteTag: ${{ github.head_ref }}
- name: Build Cleanup API
uses: ./sbl-frontend/.github/actions/build-image
with:
rootDir: regtech-cleanup-api
localImage: sbl-project-cleanup
# remoteImage: ghcr.io/cfpb/regtech/sbl/regtech-cleanup-api
- name: Build Mail API
uses: ./sbl-frontend/.github/actions/build-image
with:
rootDir: regtech-mail-api
localImage: sbl-project-mail-api
# remoteImage: ghcr.io/cfpb/regtech/sbl/regtech-mail-api
- name: Build User Fi API
uses: ./sbl-frontend/.github/actions/build-image
with:
rootDir: regtech-user-fi-management
localImage: sbl-project-user-fi
# remoteImage: ghcr.io/cfpb/regtech/sbl/regtech-user-fi-management
- name: Build Filing API
uses: ./sbl-frontend/.github/actions/build-image
with:
rootDir: sbl-filing-api
localImage: sbl-project-filing
# remoteImage: ghcr.io/cfpb/regtech/sbl/regtech-filing-api
# - name: Build Frontend
# uses: ./sbl-frontend/.github/actions/build-image
# with:
# rootDir: sbl-frontend
# localImage: sbl-project-sbl-frontend
# # remoteImage: ghcr.io/cfpb/regtech/sbl/sbl-frontend
# # remoteTag: ${{ github.head_ref }}
# - name: Build Cleanup API
# uses: ./sbl-frontend/.github/actions/build-image
# with:
# rootDir: regtech-cleanup-api
# localImage: sbl-project-cleanup
# # remoteImage: ghcr.io/cfpb/regtech/sbl/regtech-cleanup-api
# - name: Build Mail API
# uses: ./sbl-frontend/.github/actions/build-image
# with:
# rootDir: regtech-mail-api
# localImage: sbl-project-mail-api
# # remoteImage: ghcr.io/cfpb/regtech/sbl/regtech-mail-api
# - name: Build User Fi API
# uses: ./sbl-frontend/.github/actions/build-image
# with:
# rootDir: regtech-user-fi-management
# localImage: sbl-project-user-fi
# # remoteImage: ghcr.io/cfpb/regtech/sbl/regtech-user-fi-management
# - name: Build Filing API
# uses: ./sbl-frontend/.github/actions/build-image
# with:
# rootDir: sbl-filing-api
# localImage: sbl-project-filing
# # remoteImage: ghcr.io/cfpb/regtech/sbl/regtech-filing-api

# Setup node stuff
- name: Setup Node 20
Expand All @@ -155,13 +155,13 @@ jobs:
cache-dependency-path: ./sbl-frontend/yarn.lock

# Standup stack
- name: Standup Stack
run: |
cd sbl-project
docker compose --profile="backend" --profile="frontend" up -d --remove-orphans --build
# - name: Standup Stack
# run: |
# cd sbl-project
# docker compose --profile="backend" --profile="frontend" up -d --remove-orphans --build

- name: Check running containers
run: docker ps
# - name: Check running containers
# run: docker ps

# Setup for test
- name: Install Local Yarn Dependencies
Expand All @@ -170,11 +170,11 @@ jobs:
yarn
yarn playwright install --with-deps
- name: Seed Database
run: |
cd sbl-project/dev_setup/mock_data/
bash create_institutions.sh
bash insert_filing_period.sh
# - name: Seed Database
# run: |
# cd sbl-project/dev_setup/mock_data/
# bash create_institutions.sh
# bash insert_filing_period.sh

# Run tests
- name: Run Playwright Tests
Expand All @@ -192,11 +192,11 @@ jobs:
# Store artifact test results
- name: Check running containers
if: steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure'
if: always() && (steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure')
run: docker ps

- name: Export docker logs
if: steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure'
if: always() && (steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure')
run: |
mkdir -p docker-logs
docker logs sbl-project-sbl-frontend-1 > ./docker-logs/frontend.log
Expand All @@ -209,29 +209,29 @@ jobs:
docker logs sbl-project-pg-1 > ./docker-logs/postgres.log
# - name: Check Docker Logs
# if: steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure'
if: always() && (steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure')
# run: |
# ls -alh /var/lib/docker/containers/

- name: Archive Test Results
uses: actions/upload-artifact@v4
if: steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure'
if: always() && (steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure')
with:
name: playwright-reports
path: |
sbl-frontend/playwright-reports
- name: Archive Docker Containers
uses: actions/upload-artifact@v4
if: steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure'
if: always() && (steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure')
with:
name: docker-containers
path: |
docker-logs
- name: Archive Docker Logs
uses: actions/upload-artifact@v4
if: steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure'
if: always() && (steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure')
with:
name: docker-logs
path: |
Expand Down
12 changes: 7 additions & 5 deletions e2e/fixtures/testFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ export const test = baseTest.extend<{
await createDomainAssociation({ adminToken, testEmailDomain, testLei });
}

// console.log the ephemeral user data for debugging
// eslint-disable-next-line no-console
console.log('testUsername :>>', testUsername);
// eslint-disable-next-line no-console
console.log('testUserPassword :>>', testUserPassword);
if (!process.env.CI) {
// console.log the ephemeral user data for debugging
// eslint-disable-next-line no-console
console.log('testUsername :>>', testUsername);
// eslint-disable-next-line no-console
console.log('testUserPassword :>>', testUserPassword);
}

await test.step('Unauthenticated homepage: navigate to keycloak', async () => {
await page.goto('/');
Expand Down
4 changes: 1 addition & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ const BASE_REPORTERS: ReporterDescription[] = [
['blob', { outputFile: 'playwright-reports/blob.zip' }],
['json', { outputFile: 'playwright-reports/json.json' }],
['junit', { outputFile: 'playwright-reports/junit.xml' }],
['list', { printSteps: true }],
];

if (process.env.CI) {
BASE_REPORTERS[0][1].open = 'never';
BASE_REPORTERS.push(['github']);
} else {
// BASE_REPORTERS.push(['github']);
BASE_REPORTERS.push(['list', { printSteps: true }]);
}

/**
Expand Down

0 comments on commit 413af0a

Please sign in to comment.