Skip to content

Commit

Permalink
[AA-1772] Fix Admin App E2E Tests (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleiva-gap authored Sep 26, 2024
1 parent fca69de commit 5f63909
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 37 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/aa-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
run-e2e-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: main
- name: Get ODS Docker
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Docker
path: ods-docker
Expand All @@ -41,7 +41,7 @@ jobs:
chmod +x ./main/Application/EdFi.Ods.AdminApp.E2E.Tests/gh-action-setup/set-versions.sh
./main/Application/EdFi.Ods.AdminApp.E2E.Tests/gh-action-setup/set-versions.sh
- name: Run ODS
run: docker-compose -f ./main/Application/EdFi.Ods.AdminApp.E2E.Tests/gh-action-setup/compose-aa-build.yml --env-file ./main/Application/EdFi.Ods.AdminApp.E2E.Tests/gh-action-setup/.automation.env up -d
run: docker compose -f ./main/Application/EdFi.Ods.AdminApp.E2E.Tests/gh-action-setup/compose-aa-build.yml --env-file ./main/Application/EdFi.Ods.AdminApp.E2E.Tests/gh-action-setup/.automation.env up -d
- name: Verify ODS Health
run: |
chmod +x ./main/Application/EdFi.Ods.AdminApp.E2E.Tests/gh-action-setup/inspect.sh
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
docker logs ed-fi-ods-api > docker-logs/ed-fi-ods-api.log
- name: Upload Docker logs
if: failure()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: docker-logs
path: docker-logs/
Expand All @@ -82,14 +82,14 @@ jobs:
working-directory: main/Application/EdFi.Ods.AdminApp.E2E.Tests
- name: Upload results
if: success() || failure()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: test-results
path: main/Application/EdFi.Ods.AdminApp.E2E.Tests/reports/playwright-results.xml
retention-days: 10
- name: Upload execution traces
if: failure()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: playwright-execution-traces
path: main/Application/EdFi.Ods.AdminApp.E2E.Tests/traces
Expand Down
28 changes: 21 additions & 7 deletions .github/workflows/after-pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,26 @@ jobs:
report-test-results:
name: Report Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

permissions:
checks: write
pull-requests: write
# actions: read
# only needed for private repository
# contents: read
# issues: read
steps:
- name: Upload Test Results
uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 # v1.6.0
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@71072fbb1229e1317f1a8de6b04206afb461bd67 # v3.1.2
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@f355d34d53ad4e7f506f699478db2dd71da9de5f # v2.15.1
with:
artifact: csharp-tests
name: C# Unit Test Results
path: "**/*.trx"
reporter: dotnet-trx
fail-on-error: false
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.trx"
4 changes: 2 additions & 2 deletions .github/workflows/e2e-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Generate report
uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 # v1.6.0
uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0
with:
artifact: ${{ env.RESULTS_FILE }}
name: Tests Results
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-merge-or-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
shell: pwsh
steps:
- name: Checkout the Repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# MinVer needs to have more than just the current commit, so tell
# GitHub to get many more. Setting to 0 forces retrieval of _all_
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/on-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
admin-app-version: ${{ steps.versions.outputs.admin-app }}

steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
-Version $appVersion
- name: Setup Nuget.exe
uses: nuget/setup-nuget@fd9fffd6ca4541cf4152a9565835ca1a88a6eb37 #v1.1.1
uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 #v2.0.0

- name: Create NuGet Packages
if: success()
Expand All @@ -94,7 +94,7 @@ jobs:
- name: Upload Packages as Artifacts
if: success()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: "${{ env.PACKAGE_NAME }}-NuGet"
path: ./*.nupkg
Expand All @@ -111,10 +111,10 @@ jobs:
outputs:
sbom-hash-code: ${{ steps.sbom-hash-code.outputs.sbom-hash-code }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Get Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a #v3.0.2
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 #v4.1.1
with:
name: ${{ env.PACKAGE_NAME }}-NuGet

Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
- name: Upload SBOM
if: success()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: ${{ env.PACKAGE_NAME }}-SBOM
path: ./manifest
Expand Down Expand Up @@ -229,10 +229,10 @@ jobs:
run:
shell: pwsh
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Get Artifact
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a #v3.0.2
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 #v4.1.1
with:
name: ${{ env.PACKAGE_NAME }}-NuGet

Expand Down Expand Up @@ -292,17 +292,17 @@ jobs:
echo "AASQLTAGS=$AASQLTAGS" >> $GITHUB_OUTPUT
echo "VERSION=$SEMVERSION" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_HUB_TOKEN }}

- name: Extract metadata (tags, labels) for admin app image
id: metaapi
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.IMAGE_NAME }}

Expand All @@ -320,7 +320,7 @@ jobs:

- name: Extract metadata (tags, labels) for admin app sql image
id: metadatabase
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.ADMINAPP_SQL_IMAGE_NAME }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-pullrequest-dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
]
steps:
- name: Checkout code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
name: Run Linter on ${{ matrix.dockerfile.name }} Dockerfile
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/on-pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
shell: pwsh
steps:
- name: Checkout the Repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
Expand All @@ -57,17 +57,17 @@ jobs:
run: ./build.ps1 -Command UnitTest -Configuration Debug

- name: Upload Results as Workflow Artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: csharp-tests
path: "**/*.trx"
retention-days: 5

- name: Dependency Review ("Dependabot on PR")
uses: actions/dependency-review-action@c090f4e553673e6e505ea70d6a95362ee12adb94 # v3.0.3
uses: actions/dependency-review-action@9129d7d40b8c12c1ed0f60400d00c92d437adcce # v4.1.3
- name: Initialize CodeQL
if: success()
uses: github/codeql-action/init@896079047b4bb059ba6f150a5d87d47dde99e6e5 # codeql-bundle-20221211
uses: github/codeql-action/init@cf7e9f23492505046de9a37830c3711dd0f25bb3 # codeql-bundle-v2.16.2
with:
languages: csharp

Expand All @@ -76,4 +76,14 @@ jobs:

- name: Perform CodeQL Analysis
if: success()
uses: github/codeql-action/analyze@896079047b4bb059ba6f150a5d87d47dde99e6e5 # codeql-bundle-20221211
uses: github/codeql-action/analyze@cf7e9f23492505046de9a37830c3711dd0f25bb3 # codeql-bundle-v2.16.2

event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: Event File
path: ${{ github.event_path }}
2 changes: 1 addition & 1 deletion .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
contents: write
steps:
- name: Checkout the repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Delete other pre-releases and their tags
shell: pwsh
Expand Down
4 changes: 2 additions & 2 deletions docs/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ the ODS/API running in Docker:

```powershell
# From the Docker clone directory
docker-compose -f compose-shared-instance-for-local-debug.yml up -d
docker compose -f compose-shared-instance-for-local-debug.yml up -d
```

* Generate a 256 bit AES encryption key and paste it into the
Expand Down Expand Up @@ -251,7 +251,7 @@ DLLs are what runs inside of Docker.
run Docker compose using `compose-shared-instance-env-build.yml`:

```bash
docker-compose -f compose-shared-instance-env-build.yml up -d
docker compose -f compose-shared-instance-env-build.yml up -d
```

* Open a PowerShell prompt and change to the AdminApp clone directory.
Expand Down

0 comments on commit 5f63909

Please sign in to comment.