Skip to content

test: simplify consumer tests#565

Open
AlexanderLanin wants to merge 1 commit into
eclipse-score:mainfrom
etas-contrib:consumer_rewrite
Open

test: simplify consumer tests#565
AlexanderLanin wants to merge 1 commit into
eclipse-score:mainfrom
etas-contrib:consumer_rewrite

Conversation

@AlexanderLanin
Copy link
Copy Markdown
Member

@AlexanderLanin AlexanderLanin commented May 28, 2026

Why

The old consumer test was a single monolithic test function that ran all repos and commands sequentially, using os.chdir() to navigate between repo directories. This caused several problems:

  • A single test failure blocked all remaining repos and commands — no partial results.
  • os.chdir() made the working directory a global side-effect, causing subtle failures when commands ran in the wrong directory.
  • Warnings were parsed from captured stderr output with ANSI stripping and logger categorization, but only visible in the log file — not in pytest's summary. The first warning terminated the process immediately, hiding all subsequent ones.
  • The --repo filter option required comma-separated repo names and silently fell back to running all repos on typos, making targeted local runs error-prone.
  • Output was written to consumer_test.log via rich.Console, requiring a separate cat step in CI to surface it. The CI workflow had a summarize job to merge per-repo XML reports and artifacts.
  • test_commands was a separate field from commands, inconsistently populated — only module_template used it, with no tests actually wired up.

What

Parametrized test structure — the single test function is replaced with a @pytest.mark.parametrize test over every combination of (repo, override_type, command). Each combination is now an independent test case that can pass, fail, or be xfailed individually. No more sequential blocking.

No os.chdir() — every subprocess call passes an explicit cwd= argument. The working directory never changes.

local and remote override types as first-class test dimensions — instead of running both override types inside a single test, each is a separate parametrized case. Remote tests check at collection time whether the commit is pushed and fail with a clear reason if not.

Warnings forwarded to pytestWARNING lines are forwarded via warnings.warn() as the process runs; pytest collects them individually in its warnings summary. The process runs to completion before failing.

Plain stdout instead of log file — output goes to print() directly, visible with -s. The consumer_test.log file and the CI artifact upload machinery are removed.

-k replaces --repo — repo and override type filtering uses standard pytest -k syntax, consistent with the rest of the test suite.

Changes

  • src/tests/test_consumer.py — full rewrite: parametrized tests, no os.chdir, local/remote override split, warning forwarding, rich dependency removed, get_current_git_hash from helper_lib used instead of a local reimplementation
  • src/tests/conftest.py--repo option removed; --disable-cache kept
  • .github/workflows/consumer_test.yml — matrix updated to "<repo> and local" / "<repo> and remote" entries passed as -k filter; summarize job and artifact upload removed; --lockfile_mode=error removed from ide_support call
  • .gitignore — added /.codex and /.claude

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 28, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //src:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: 5e5d8e93-c9e3-4d8a-98ba-ebb66701d2e3
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: src
WARNING: Target pattern parsing failed.
ERROR: Skipping '//src:license-check': no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
ERROR: no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
INFO: Elapsed time: 5.408s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@github-actions
Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@AlexanderLanin AlexanderLanin self-assigned this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant