Skip to content

ci: run the Azurite storage tests in the build-and-test job - #258

Open
mwg-bender[bot] wants to merge 1 commit into
devfrom
ci/060-azurite-api-tests
Open

mwg-bender[bot] wants to merge 1 commit into
devfrom
ci/060-azurite-api-tests

Conversation

@mwg-bender

@mwg-bender mwg-bender Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

CI now runs the Azurite storage tests (StorageQueryAzuriteTests) instead of reporting them as skipped. This closes the last open item of #194 (item 4: "All four Azurite tests skip in CI because .github sets no EM_AZURITE_CONNECTION"). The old-text conversion tests were retired in #247, so two Azurite tests remain, not four.

This PR changes a workflow, so it needs a human review. Do not merge it without Woody's approval. Nerd has not merged it and will not.

Cause

.github/workflows/ci.yml ran the Api tests without EM_AZURITE_CONNECTION. AzuriteSupport.Connection() then marks both Azurite tests inconclusive, which CI counts as skipped. The dev tip run 45884045274 reports Api.Tests total 903, executed 901, passed 901 and NotExecuted 2. Both NotExecuted results are StorageQueryAzuriteTests, each with the message "Azurite test skipped: set EM_AZURITE_CONNECTION to an Azurite connection string."

Change

Only .github/workflows/ci.yml changes (+24 lines). In the build-and-test job, after Build and before Api tests:

  • Set up Node.js: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0, node 22. This is the same sha pin as e2e.yml.
  • Install Azurite: npm install --global azurite@3.37.0, the same pinned version as e2e.yml.
  • Start Azurite: uses the same command as e2e.yml (nohup azurite --silent --skipApiVersionCheck --location "$RUNNER_TEMP/azurite"). The step then waits up to 60 s until both the Blob port (10000) and the Table port (10002) answer. If they do not, it fails and prints the Azurite log.
  • Api tests: gains env: EM_AZURITE_CONNECTION: UseDevelopmentStorage=true, set on this step only. Web tests do not see it.

Job and workflow permissions are unchanged. continue-on-error and the final "Fail if any step failed" gate are unchanged. Every action is still pinned by sha.

Validation

  • Cold local baseline on dev 6950275: 0 errors, 0 warnings. Api 901 passed + 2 skipped (903), Web 1245, E2E 18 (5 passed + 13 skipped without a stack). This PR touches no source file, so the local numbers do not change.
  • CI evidence: the Api.Tests counts before and after, the StorageQueryAzuriteTests outcomes from this PR's trx, and a break-it run (the variable pointed at an unreachable local port, which turns the Api step red) are posted as a PR comment by Nerd. The comment carries the DISPOSITION for chore(api): follow-ups from the review of the API, conversion tests and docs follow-ups (#191) #194 item 4.
  • Flows: no flows were run (this is a CI-only change).

Notes

Refs #194. Nerd closes #194 by hand once every item has a disposition.

The two StorageQueryAzuriteTests skip unless EM_AZURITE_CONNECTION is set,
and ci.yml never set it, so CI reported them as skipped on every run.

The build-and-test job now sets up Node.js and installs Azurite with the
same pins as the E2E workflow (setup-node v7.1.0 by sha, azurite@3.37.0),
starts it on a throwaway location under $RUNNER_TEMP, waits until the Blob
and the Table port answer, and sets EM_AZURITE_CONNECTION to
UseDevelopmentStorage=true for the Api tests step only. Permissions and the
continue-on-error behaviour of the test steps are unchanged.

Refs #194
@github-actions

Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2148 2148 0 0 0 0 1m 15s

🎉 No failed tests in this run.

Github Test Reporter by CTRF 💚

@mwg-bender

mwg-bender Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Nerd review of 89f5170 (workflow change: needs Woody's review before merge)

DISPOSITION #194 item 4 (Azurite tests skip in CI): DONE in this PR. Not merged by me because it changes a workflow.

Diff: .github/workflows/ci.yml only, +24 lines. setup-node and azurite@3.37.0 use the same pins as e2e.yml. Azurite is started under $RUNNER_TEMP and the step waits up to 60 s for the Blob (10000) and Table (10002) ports. EM_AZURITE_CONNECTION=UseDevelopmentStorage=true is set on the Api tests step only. Permissions, continue-on-error and the final failure gate are unchanged.

CI evidence (run 45885520014, head 89f5170): build-and-test and e2e both succeeded. The test report counts 2148 tests: 2148 passed, 0 skipped, 0 failed. That is Api 903 + Web 1245. The dev tip run 45884045274 had Api 901 passed + 2 NotExecuted (both StorageQueryAzuriteTests), so skipped dropped from 2 to 0.

Break-it, run locally on the Api test build:

  • StorageQueryAzuriteTests without EM_AZURITE_CONNECTION: Skipped 2 of 2.
  • With EM_AZURITE_CONNECTION=UseDevelopmentStorage=true and no Azurite listening: Failed 2 of 2. So an unreachable endpoint turns the Api step red instead of silently skipping.

No source files changed; build counts are unchanged from dev 6950275.

@mwg-bender

mwg-bender Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Mutation evidence (probe PR #259, head 3d4a7de, run 45886332231): with EM_AZURITE_CONNECTION pointed at a loopback port nothing listens on, build-and-test fails. Azurite start succeeded; Api tests ran with the broken endpoint; the final "Fail if any step failed" gate turned the job red (the Api step itself reports success because of continue-on-error, the gate reads its outcome). Web tests and e2e stayed green. So an unreachable Azurite fails CI instead of silently skipping. #259 is closed unmerged and its branch deleted.

@mwg-bender

mwg-bender Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Worker result for card t_634baea2 (head 89f5170)

This PR changes a workflow, so it needs Woody's review. The worker has not merged it.

DISPOSITION

CI evidence (read from the run's own api.trx artifact and job log)

dev tip 6950275, run 45884045274 this PR 89f5170, run 45885520014
Api.Tests (trx counters) total 903, passed 901, NotExecuted 2 total 903, passed 903, NotExecuted 0
StorageQueryAzuriteTests.CommentListAndActivityDeleteQueryRealStorageForThatActivityOnly NotExecuted: "Azurite test skipped: set EM_AZURITE_CONNECTION…" Passed (0.247 s)
StorageQueryAzuriteTests.LikeCountInRealStorageCountsOnlyDFormEventIds NotExecuted (same message) Passed (0.025 s)
Web.Tests 1245 passed 1245 passed

The skipped count dropped by 2, which is the number of Azurite tests. The job log shows Azurite up after 3s and Passed! - Failed: 0, Passed: 903, Skipped: 0, Total: 903. The trx test output shows that real storage answered. Examples: PASS rows storage returned to the two list queries: expected 2, 1, actual 2, 1 and PASS Like count of …: expected 2, actual 2. All seven checks on the head are green: build-and-test, e2e, CodeQL, the three Analyze jobs, and submit-nuget.

Mutation (break-it)

The probe ran on a separate throwaway draft, #259 (head 3d4a7de = 89f5170 + 1 commit), run 45886332231. Rewriting this PR's branch would have needed a force-push, so the probe commit was never pushed here. In the probe, EM_AZURITE_CONNECTION pointed at TableEndpoint=http://127.0.0.1:1/devstoreaccount1 with the Azurite well-known account. The loopback guard lets that string through, so the tests run and cannot reach storage.

  • The Api tests step's dotnet test exited 1: Failed! - Failed: 2, Passed: 901, Skipped: 0, Total: 903. Both StorageQueryAzuriteTests failed with Connection refused (127.0.0.1:1). Its trx shows outcome Failed, failed 2.
  • Because of continue-on-error, the step's conclusion still reads success. The unchanged "Fail if any step failed" gate reads its outcome and turned build-and-test red.
  • ci: mutation probe for #258 (throwaway, do not merge) #259 is closed unmerged, and its branch ci/060-azurite-api-tests-mutation no longer exists (GET /branches/… returns 404). This PR is still exactly one commit, 89f5170.

I also ran a local pre-check with the same string against the Api test build: Failed: 2, Passed: 0, Skipped: 0.

Counts (local, cold, --no-incremental)

Baseline on dev 6950275 and after on 89f5170 are identical, since no source changed and the variable is unset locally: 0 errors, 0 warnings; Api 901 passed + 2 skipped (903); Web 1245; E2E 18 (5 passed + 13 skipped without a stack). The change shows only in CI: Api goes from 901 + 2 skipped to 903 + 0 skipped.

Observations for Nerd

  1. README (README.md:109-125) still describes the Azurite tests as opt-in only. It could add one sentence saying CI's build-and-test now runs them against Azurite. I left it unedited, as the card says.
  2. Stale baseline in CARD_COMMON.md: it says Api 495 + 4 skipped, but dev now has Api 903 (901 + 2 skipped) and Web 1245. chore(api): remove the one-time Activity old-text conversion #247 retired the two conversion Azurite tests, and the 0.6.0 work added tests. The issue text of chore(api): follow-ups from the review of the API, conversion tests and docs follow-ups (#191) #194.4 also still says "four" Azurite tests.
  3. Pre-existing annotation: actions/upload-artifact@ea165f8… (v4) targets Node.js 20 and is forced onto Node 24. This is not from this PR.
  4. Tooling: the gh-api.sh helper does not follow redirects, so job logs and artifact zips return nothing through it. I downloaded them with a scratch curl -L script run under the same GitHub App helper, so the token stayed in the helper's environment.
  5. Concurrent actor: another mwg-bender[bot] session posted two comments on this PR while the worker was running, and it deleted the probe branch before my delete call (my delete got 422 "Reference does not exist"). Its first comment's local break-it used UseDevelopmentStorage=true with no Azurite running; mine used port 1. The two results agree.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants