Skip to content

Commit 2a58dce

Browse files
committed
Test early exit clean-up (msaccess-vcs-build@bugfix/build-early-exit-cleanup)
1 parent becbe44 commit 2a58dce

1 file changed

Lines changed: 36 additions & 3 deletions

File tree

‎.github/workflows/test-accunit-junit-xml.yml‎

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test AccUnit JUnit XML (msaccess-vcs-build@feature/accunit-download)
1+
name: Test AccUnit JUnit XML (msaccess-vcs-build@bugfix/build-early-exit-cleanup)
22

33
on:
44
push:
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/checkout@v4
1616

1717
- name: "A: Build add-in, AccUnit tests without JUnit XML"
18-
uses: AccessCodeLib/msaccess-vcs-build@feature/accunit-download
18+
uses: AccessCodeLib/msaccess-vcs-build@bugfix/build-early-exit-cleanup
1919
with:
2020
source-dir: "source"
2121
target-dir: "bin"
@@ -24,7 +24,7 @@ jobs:
2424
timeout-minutes: 10
2525

2626
- name: "B: Build DeclDictTester, AccUnit tests with JUnit XML"
27-
uses: AccessCodeLib/msaccess-vcs-build@feature/accunit-download
27+
uses: AccessCodeLib/msaccess-vcs-build@bugfix/build-early-exit-cleanup
2828
with:
2929
source-dir: "DeclDictTester.accdb.src"
3030
target-dir: "bin"
@@ -33,6 +33,39 @@ jobs:
3333
accunit-junit-xml: "bin/accunit-results.xml"
3434
timeout-minutes: 10
3535

36+
- name: "Count trusted locations before D"
37+
if: always()
38+
shell: pwsh
39+
run: |
40+
$regPath = "HKCU:\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations"
41+
$before = @(Get-ChildItem $regPath | Where-Object { $_.PSChildName -like "VCS-build-folder_*" })
42+
$before | ForEach-Object { Write-Host "Existing: $($_.PSChildName) = $($_.GetValue('Path'))" }
43+
"TL_BEFORE=$($before.Count)" | Out-File -FilePath $env:GITHUB_ENV -Append
44+
45+
- name: "D: Build with invalid accunit-url (must fail, trusted location must be removed)"
46+
id: invalid_accunit_url
47+
continue-on-error: true
48+
uses: AccessCodeLib/msaccess-vcs-build@bugfix/build-early-exit-cleanup
49+
with:
50+
source-dir: "DeclDictTester.accdb.src"
51+
target-dir: "bin-fail"
52+
file-name: "DeclDictTester.accdb"
53+
run-accunit-tests: true
54+
accunit-url: "https://api.github.com/repos/AccessCodeLib/AccUnit/releases/tags/does-not-exist"
55+
timeout-minutes: 10
56+
57+
- name: "E: Check result of D and leftover trusted locations"
58+
if: always()
59+
shell: pwsh
60+
run: |
61+
Write-Host "Outcome of D: ${{ steps.invalid_accunit_url.outcome }}"
62+
$regPath = "HKCU:\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations"
63+
$leftover = @(Get-ChildItem $regPath | Where-Object { $_.PSChildName -like "VCS-build-folder_*" })
64+
$leftover | ForEach-Object { Write-Host "Existing: $($_.PSChildName) = $($_.GetValue('Path'))" }
65+
Write-Host "VCS-build-folder trusted locations before D: $env:TL_BEFORE, after D: $($leftover.Count)"
66+
if ("${{ steps.invalid_accunit_url.outcome }}" -ne "failure") { Write-Error "D did not fail" }
67+
if ($leftover.Count -gt [int]$env:TL_BEFORE) { Write-Error "D left a trusted location behind" }
68+
3669
- name: "Show JUnit XML"
3770
if: always()
3871
shell: pwsh

0 commit comments

Comments
 (0)