Add an end-to-end Azure Functions SQL trigger test #2
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/functions-trigger-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Adds
tests/functions-trigger/, an end-to-end test of the Azure Functions SQL trigger against the lab container, and records the result in the README.Microsoft's container FAQ lists Change Tracking as not included, while the Functions SQL trigger, which depends on it, is documented as the local event-driven option. This test shows what happens with a real function: a .NET 8 isolated worker (packages pinned, NuGetAudit failing the build on any known vulnerability), Azure Functions Core Tools 4.16.0, and Azurite pinned by digest. The script creates a scratch database and a throwaway login with a random password, writes the only copy of that password to
local.settings.jsonin a temporary folder (the Functions host reads connection settings from there or from environment variables), runs inserts, updates and deletes, checks what the function received, and always cleans up: host, Azurite, login, database and folder.Also adds
bin/,obj/andlocal.settings.jsonto.gitignore, and lists the test-time tools inTHIRD-PARTY-NOTICES.md.Fixes #
How was this tested?
shellcheck scripts/*.sh compose/*.shis clean (no shell changes)tests/functions-trigger/Test-FunctionsTrigger.ps1in PowerShell 7 and in Windows PowerShell 5.1: both PASS, withInsert Id=2 Title=second, updatedandDelete Id=1 Title=(Change Tracking net changes). Afterwards: no temporary folder, no Azurite container, nofuncprocess, and noct_func_scratchdatabase orct_func_testlogin.dotnet list package --vulnerable --include-transitive: no vulnerable packages (52 including transitive)Checklist
docker inspector the console. The sa password is not used at all; the throwaway login's password exists only in the temporarylocal.settings.jsonand the dropped login.