Skip to content

GHA TESTS - Improve logging to group in the right place - #13807

Merged
cderv merged 6 commits into
mainfrom
gha/improve-logging
Dec 19, 2025
Merged

GHA TESTS - Improve logging to group in the right place #13807
cderv merged 6 commits into
mainfrom
gha/improve-logging

Conversation

@cderv

@cderv cderv commented Dec 17, 2025

Copy link
Copy Markdown
Member

This PR follows up previous one #13787 by trying to group in a more scoped place.

@cderv
cderv marked this pull request as draft December 17, 2025 13:34
@posit-snyk-bot

posit-snyk-bot commented Dec 17, 2025

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv

cderv commented Dec 19, 2025

Copy link
Copy Markdown
Member Author

Here is the new state

Playwright tests logging

All test is grouped, but failure is shown outside the group

image

Then inside the group we get logging about each document render in pre-test step
image

Then the playwright logging itself is at its minimum (dot reporter) with error shown after
image

image

smoke test logging

Each test is grouped and error shows below the failing grouped test with summary at the end
image

Unfolding shows the details
image

Same for smoke-all document
image

Still small tweaks but this is better. #13808 will also help reduce the Deno logging about dependencies download.

Adds fallback behavior to src/tools/github.ts for local development:
- error/warning/notice functions now print to console when not in GHA
- withGroup/withGroupAsync print titles directly instead of using workflow commands
Adds automatic DEBUG level logging when RUNNER_DEBUG=1 is set in GitHub
Actions environment. Can be overridden by explicit --log-level or
QUARTO_LOG_LEVEL environment variable.
- Suppress webServer output (stderr: 'ignore' in playwright.config.ts)
- Add respectStreams: true to execProcess for clearer test output
- Add environment variables for test flexibility (SKIP_RENDER, SKIP_CLEANOUTPUT)
- Improve document rendering logging with relative paths
@cderv
cderv force-pushed the gha/improve-logging branch from d8c8fc3 to d1fa9c1 Compare December 19, 2025 14:59
- Add ::group::/::endgroup:: around test file execution in test-smokes.yml
- Remove QUARTO_LOG_LEVEL: DEBUG from workflow
- Remove unnecessary echo statements from run-tests.sh

GitHub Actions doesn't support nested groups, so only workflow-level grouping is used.
Adds three intentionally failing tests to validate that grouping improvements
work correctly in CI logs:

- Playwright test (tests/integration/playwright/tests/)
- Unit test (tests/unit/)
- Smoke-all document (tests/docs/smoke-all/)

These tests should be removed after verifying CI log behavior.
@cderv
cderv force-pushed the gha/improve-logging branch from d1fa9c1 to f664f1c Compare December 19, 2025 15:03
@cderv
cderv marked this pull request as ready for review December 19, 2025 15:03
@cderv
cderv merged commit ade5aba into main Dec 19, 2025
53 of 54 checks passed
@cderv
cderv deleted the gha/improve-logging branch December 19, 2025 15:27
cderv added a commit to cderv/quarto-cli that referenced this pull request Jul 20, 2026
The bucketed CI runs got navigable logs by wrapping each file in a
::group:: at the workflow level (quarto-dev#13787/quarto-dev#13807), but the default
non-bucketed run is one giant deno test whose thousands of flat lines
have no structure. Have the harness itself open a group per test file so
that path collapses the same per-test noise the bucket loop does.

Grouping lives in a small state machine (gha-grouping.ts) so the
single-open-group invariant — the GitHub runner cannot nest groups — is
enforced and unit-testable in isolation. The harness opens/transitions
the group at the start of each test's fn, closes it on the failure path
before fail() throws (so the FAILED line and ::error land outside the
collapsed group), and closes any open group at unload before the Phase 1
aggregate error and Deno's terminal ERRORS/FAILURES sections.

Every emission is gated on harnessOwnsStep() (on CI, no outer
orchestrator), the same ownership switch Phase 1 uses: local runs and
orchestrated bucket runs stay byte-identical, so the quarto-dev#13807 bucket log
format is untouched. Closure is lazy per file; direct Deno.test files
are a documented exemption. Design and invariants:
dev-docs/ci-test-log-grouping-design.md.
cderv added a commit to cderv/quarto-cli that referenced this pull request Jul 20, 2026
The bucketed CI runs got navigable logs by wrapping each file in a
::group:: at the workflow level (quarto-dev#13787/quarto-dev#13807), but the default
non-bucketed run is one giant deno test whose thousands of flat lines
have no structure. Have the harness itself open a group per test file so
that path collapses the same per-test noise the bucket loop does.

Grouping lives in a small state machine (gha-grouping.ts) so the
single-open-group invariant — the GitHub runner cannot nest groups — is
enforced and unit-testable in isolation. The harness opens/transitions
the group at the start of each test's fn, closes it on the failure path
before fail() throws (so the FAILED line and ::error land outside the
collapsed group), and closes any open group at unload before the Phase 1
aggregate error and Deno's terminal ERRORS/FAILURES sections.

Every emission is gated on harnessOwnsStep() (on CI, no outer
orchestrator), the same ownership switch Phase 1 uses: local runs and
orchestrated bucket runs stay byte-identical, so the quarto-dev#13807 bucket log
format is untouched. Closure is lazy per file; direct Deno.test files
are a documented exemption. Design and invariants:
dev-docs/ci-test-log-grouping-design.md.
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.

2 participants