Skip to content

Improve CI debuggability with structured test logging#22

Merged
dahlia merged 4 commits into
fedify-dev:mainfrom
dahlia:ci-debuggability
Jul 3, 2026
Merged

Improve CI debuggability with structured test logging#22
dahlia merged 4 commits into
fedify-dev:mainfrom
dahlia:ci-debuggability

Conversation

@dahlia

@dahlia dahlia commented Jul 3, 2026

Copy link
Copy Markdown
Member

Replace node:test's describe/it with @logtape/testing-node/autoload so test failures include structured log output. Upgrades @logtape/logtape and @logtape/graphql-yoga to matching dev builds.

Adds LOGTAPE_TEST_MODE and LOGTAPE_TEST_LOWEST_LEVEL to CI (GitHub Actions) and local mise run test, plus a -d/--debug flag that shows trace-level logs on every test run.

@dahlia dahlia added this to the DrFed 0.1.0 milestone Jul 3, 2026
@dahlia dahlia self-assigned this Jul 3, 2026
@dahlia dahlia added the enhancement New feature or request label Jul 3, 2026
@dahlia dahlia requested review from 2chanhaeng, dodok8 and sij411 July 3, 2026 08:37
dahlia added 4 commits July 3, 2026 17:37
Change the mise log_level from debug to trace in the setup-mise action,
and add MISE_LOG_LEVEL environment variable to the run steps for both
the check and test jobs. This ensures mise outputs more detailed logs
when runner.debug is enabled, helping diagnose CI issues.
Add LogTape logging throughout the application stack:

- CLI: --log-level/-L and --log-output options via @optique/logtape
  integration (loggingOptions with level: "option")
- Database: Drizzle ORM queries logged via @logtape/drizzle-orm
- GraphQL Yoga: request/response logging via @logtape/graphql-yoga
- Server: configure() with console sink at startup in
  packages/drfed/src/index.ts

Update the dev task in mise.toml and scripts/dev.mts to pass
--log-level (defaulting to "debug") and --log-output through to
the development server process.
Replace all node:test describe/it imports with
@logtape/testing-node/autoload, which integrates log output with
the test runner for better debugging.

Update @logtape/logtape and @logtape/graphql-yoga to 2.3.0-dev.840
to match the testing-node dependency.

Add LOGTAPE_TEST_MODE and LOGTAPE_TEST_LOWEST_LEVEL environment
variables to both CI workflow and local mise test task to control
when and at what level log output is shown during tests.
Replace static environment variables with a Nushell script
that supports a --debug flag.  When the flag is set, log output
is shown at trace level always; otherwise it defaults to showing
logs on failure at debug level.
@dahlia dahlia force-pushed the ci-debuggability branch from aa531d4 to 8aa7ad5 Compare July 3, 2026 08:40
@dahlia dahlia moved this from Todo to In progress in NLnet NGI0 Commons Fund (2026) Jul 3, 2026

@2chanhaeng 2chanhaeng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@dahlia dahlia merged commit 4a7f041 into fedify-dev:main Jul 3, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in NLnet NGI0 Commons Fund (2026) Jul 3, 2026
@dahlia dahlia deleted the ci-debuggability branch July 3, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

3 participants