Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added URL fetch error handling to test script #642

Merged
merged 36 commits into from
Nov 17, 2023
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
20ac8b7
Added skeleton
AlexanderSehr Nov 7, 2023
4939b4d
Implemented first new tests
AlexanderSehr Nov 7, 2023
4e1d86f
Changed to warning
AlexanderSehr Nov 8, 2023
94fff0b
Expanded test verbosity & added additional tets
AlexanderSehr Nov 8, 2023
c18ce6b
Finalized further tests
AlexanderSehr Nov 8, 2023
a343694
Update to latest
AlexanderSehr Nov 8, 2023
3a6f0a2
Update to latest
AlexanderSehr Nov 8, 2023
4ab6a5b
Added module name + small fix
AlexanderSehr Nov 8, 2023
9bb64bd
Fixed kvlt
AlexanderSehr Nov 8, 2023
68e2bd2
Small caching fix
AlexanderSehr Nov 8, 2023
1a013c2
Small fix and enabled passthru of warnings to GH
AlexanderSehr Nov 8, 2023
1c2fc8a
More updates
AlexanderSehr Nov 8, 2023
d9c6dd5
Update to latest
AlexanderSehr Nov 8, 2023
dd0c343
Updated test names
AlexanderSehr Nov 8, 2023
2ebd458
JSON rollback
AlexanderSehr Nov 8, 2023
f6caf7e
Updated regex
AlexanderSehr Nov 8, 2023
f56f66a
Removed assertion
AlexanderSehr Nov 8, 2023
282b640
Update to latest
AlexanderSehr Nov 8, 2023
c025f52
Update avm/utilities/pipelines/staticValidation/compliance/module.tes…
AlexanderSehr Nov 9, 2023
405901a
Update avm/utilities/pipelines/staticValidation/compliance/module.tes…
AlexanderSehr Nov 9, 2023
904c82f
Merge branch 'main' into users/alsehr/testFileCompliance
AlexanderSehr Nov 9, 2023
ef24d1f
Rollback of unrelated changes
AlexanderSehr Nov 9, 2023
9393aa1
Merge branch 'Azure:main' into main
AlexanderSehr Nov 9, 2023
cb39086
Merge branch 'Azure:main' into main
AlexanderSehr Nov 9, 2023
89eac40
Merge branch 'Azure:main' into main
AlexanderSehr Nov 10, 2023
712a673
Merge branch 'Azure:main' into main
AlexanderSehr Nov 13, 2023
55e095f
Resolved conflict
AlexanderSehr Nov 14, 2023
3121335
Update to latest
AlexanderSehr Nov 14, 2023
e9d736c
Merge branch 'Azure:main' into main
AlexanderSehr Nov 15, 2023
abfa1b9
Merge branch 'Azure:main' into main
AlexanderSehr Nov 15, 2023
c6707f6
Merge branch 'Azure:main' into main
AlexanderSehr Nov 16, 2023
246f9ba
Merge branch 'Azure:main' into main
AlexanderSehr Nov 16, 2023
8c7e316
Improved robustness of tests
AlexanderSehr Nov 16, 2023
50696b1
Added proper error handling to web-request
AlexanderSehr Nov 16, 2023
6e9729d
Merge branch 'Azure:main' into main
AlexanderSehr Nov 16, 2023
27d0f1d
Merge branch 'main' into users/alsehr/errorHandling
AlexanderSehr Nov 16, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,18 @@ Describe 'Module tests' -Tag 'Module' {
}
$implementedSchema = $templateFileContentBicep[$implementedSchemaStartIndex..$implementedSchemaEndIndex]

$expectedSchemaFull = (Invoke-WebRequest -Uri $expectedUdtUrl).Content -split '\n'
try {
$rawReponse = Invoke-WebRequest -Uri $expectedUdtUrl
if (($rawReponse.Headers['Content-Type'] | Out-String) -like "*text/plain*") {
$expectedSchemaFull = $rawReponse.Content -split '\n'
} else {
throw "Failed to fetch schema from [$expectedUdtUrl]. Skipping schema check"
}
} catch {
Write-Warning "Failed to fetch schema from [$expectedUdtUrl]. Skipping schema check"
return
}

$expectedSchemaStartIndex = $expectedSchemaFull.IndexOf("type $udtName = {")
$expectedSchemaEndIndex = $expectedSchemaStartIndex + 1
while ($expectedSchemaFull[$expectedSchemaEndIndex] -notmatch '^\}.*' -and $expectedSchemaEndIndex -lt $expectedSchemaFull.Length) {
Expand Down