Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
222fa66
Initial UI tests jc wk (#11)
JC-wk Dec 19, 2025
4c48dc7
bump ui version
Dec 19, 2025
894d744
update changelog
Dec 19, 2025
7be1886
create ui tests workflow
Dec 19, 2025
eb5925b
Copy config.source.json to config.json
Dec 19, 2025
71b0fe5
update retention
Dec 19, 2025
61e3e2e
Merge branch 'main' into ui-tests
JC-wk Dec 19, 2025
228c02f
update version
Dec 19, 2025
f6456b3
Merge branch 'ui-tests' of https://github.com/JC-wk/AzureTRE into ui-…
Dec 19, 2025
340611e
update yarn.lock
Dec 19, 2025
f999927
remove frozen lockfile
Dec 19, 2025
aff37d5
fix yarn install
Dec 19, 2025
01a949c
publish test results
Dec 19, 2025
a398404
add UI tests to PR Bot reports
Dec 19, 2025
b71d922
add ui tests to pr bot
Dec 19, 2025
a27c2f6
fix lint errors and migrate eslint to @nabla/vite-plugin-eslint
Dec 19, 2025
80c3d71
revert eslint, combine tests
Dec 19, 2025
5406266
update ui test
Dec 19, 2025
f7981aa
support download of multiple artifacts
Dec 19, 2025
b75f990
publish results after test has finished
Dec 19, 2025
302f824
rename
Dec 19, 2025
9506884
rename
Dec 19, 2025
c5e5032
wait for all tests before publishing results
Dec 19, 2025
98ab6dc
add ---
Dec 19, 2025
4b49973
test results update
Dec 19, 2025
d007ff6
fix repo path
Dec 19, 2025
4ab7061
rename artifact
Dec 19, 2025
0fd76d6
remove retention
Dec 19, 2025
12484ab
rename coverage report and publish result
Dec 19, 2025
d0743e8
revert test_results.yaml
Dec 19, 2025
cc94f90
update ui_tests
Dec 19, 2025
29ce372
fix test report
Dec 19, 2025
7e01ed6
update coverage report
Dec 19, 2025
69820b1
move test reports to results file
Dec 19, 2025
a1bf1f7
fix file path
Dec 19, 2025
05e312e
update costsTag and associated tests
Dec 19, 2025
044ea0f
Merge branch 'main' into ui-tests
JC-wk Jan 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@
"mikestead.dotenv",
"humao.rest-client",
"timonwong.shellcheck",
"ms-azuretools.vscode-azurefunctions"
"ms-azuretools.vscode-azurefunctions",
"vitest.explorer"
]
}
},
Expand Down
7 changes: 7 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Azure TRE uses the following key technologies:
├── api_app - API source code and docs
├── resource_processor - VMSS Porter Runner
├── scripts - Utility scripts
├── ui - React-based web UI with TypeScript
└── templates - Resource templates
├── core/terraform - Terraform definitions of Azure TRE core resources
├── shared_services - Terraform definitions of shared services
Expand Down Expand Up @@ -81,6 +82,12 @@ Azure TRE uses the following key technologies:

- **TypeScript/JavaScript**:
- Follow standard ESLint configuration
- Use Vitest for testing React components
- Use React Testing Library for component testing
- Mock FluentUI components in tests due to JSDOM limitations
- Maintain 80% code coverage across branches, functions, lines, and statements
- Focus on testing user interactions and component behavior
- Use semantic queries (getByRole, getByLabelText) over test IDs when possible

- **YAML**:
- Use consistent indentation (2 spaces)
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/test_results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This workflow is required to publish test results from forks
name: Test Results

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
workflow_run:
workflows: ["Docker build"]
types:
Expand Down Expand Up @@ -31,16 +31,16 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
mkdir -p artifacts && cd artifacts
mkdir -p artifacts && cd artifacts

artifacts_url=${{ github.event.workflow_run.artifacts_url }}
artifacts_url=${{ github.event.workflow_run.artifacts_url }}

gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read -r artifact
do
IFS=$'\t' read -r name url <<< "$artifact"
gh api "$url" > "$name.zip"
unzip -d "$name" "$name.zip"
done
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read -r artifact
do
IFS=$'\t' read -r name url <<< "$artifact"
gh api "$url" > "$name.zip"
unzip -d "$name" "$name.zip"
done

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/ui_test_results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
# This workflow is required to publish test results from forks
name: UI Test Results

on: # yamllint disable-line rule:truthy
workflow_run:
workflows: ["UI Tests"]
types:
- completed
# actionlint doesn't like the following line depite it being recommanded:
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#overview
# permissions: {}

jobs:
ui-test-results:
name: UI Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

permissions:
checks: write

# needed unless run with comment_mode: off
pull-requests: write

# required by download step to access artifacts API
actions: read

steps:
- name: Download and Extract Artifacts
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
mkdir -p artifacts && cd artifacts

artifacts_url=${{ github.event.workflow_run.artifacts_url }}

gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read -r artifact
do
IFS=$'\t' read -r name url <<< "$artifact"
gh api "$url" > "$name.zip"
unzip -d "$name" "$name.zip"
done

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/UI Tests Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"
check_name: "UI Test Results"

# # The following step is the catch situations where the tests didn't run at all.
# - name: Check failure files
# run: |
# if compgen -G "artifacts/**/pytest*failed" > /dev/null; then
# echo "Tests failure file(s) exist. Some tests have failed or didn't run at all! \
# Check the artifacts for details."
# exit 1
# fi

# For PR builds triggered from comment builds, the GITHUB_REF is set to main
# so the checks aren't automatically associated with the PR
# If prHeadSha is specified then explicity mark the checks for that SHA
- name: Report check status
if: github.event.workflow_run.head_sha != ''
uses: LouisBrunner/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
# the name must be identical to the one received by the real job
sha: ${{ github.event.workflow_run.head_sha }}
name: "Test Results"
status: "completed"
conclusion: ${{ github.event.workflow_run.conclusion }}
details_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"

## Vitest Coverage Report
## Check out the repository to obtain the vitest.config file
- name: Checkout repository
uses: actions/checkout@v5

- name: Download UI Test coverage report
uses: actions/download-artifact@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Report coverage comparison
uses: davelosert/vitest-coverage-report-action@v2
with:
working-directory: ui/app/
75 changes: 75 additions & 0 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
name: UI Tests

on: # yamllint disable-line rule:truthy
pull_request:
branches: [main]
paths:
- "ui/app/**"
- ".github/workflows/ui_tests.yml"
push:
branches: [main]
paths:
- "ui/app/**"

# for each ref (branch/pr) run just the most recent,
# cancel other pending/running ones
concurrency:
group: "${{ github.workflow }}-${{ github.head_ref }}"
cancel-in-progress: true

jobs:
vitest:
name: Run vitest
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"

- name: Install dependencies
working-directory: ui/app
run: yarn install

- name: Copy config.source.json to config.json
working-directory: ui/app/src
run: cp config.source.json config.json

- name: Run vitest
working-directory: ui/app
run: yarn test:coverage --run --reporter=junit --outputFile=junit.xml

- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: ui-test-coverage-report
path: ui/app/coverage
retention-days: 10

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: ui-test-results
path: ui/app/junit.xml
retention-days: 10

# this step is required to publish test results from forks
- name: Upload Event File
uses: actions/upload-artifact@v4
with:
name: UI Tests Event File
path: ${{ github.event_path }}
retention-days: 10
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ENHANCEMENTS:
* API: Replace HTTP_422_UNPROCESSABLE_ENTITY response with HTTP_422_UNPROCESSABLE_CONTENT as per RFC 9110 ([#4742](https://github.com/microsoft/AzureTRE/issues/4742))
* Change Group.ReadWrite.All permission to Group.Create for AUTO_WORKSPACE_GROUP_CREATION ([#4772](https://github.com/microsoft/AzureTRE/issues/4772))
* Make workspace shared storage quota updateable ([#4314](https://github.com/microsoft/AzureTRE/issues/4314))
* Implement UI testing with vitest ([#4794](https://github.com/microsoft/AzureTRE/pull/4794))

BUG FIXES:
* Fix circular dependancy in base workspace. ([#4756](https://github.com/microsoft/AzureTRE/pull/4756))
Expand Down
Loading
Loading