TEST-INFRA: [ci-pipeline-design] Optimize noxfile.py for CI Environments #1723

Open
opened 2026-04-02 23:36:03 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: chore/ci-optimize-noxfile-for-ci
  • Commit Message: chore(ci): optimize noxfile.py for CI environments
  • Milestone: v3.8.0
  • Parent Epic: #1678

Background and Context

The current noxfile.py is well-suited for local development, but it could be further optimized for CI environments. Specifically, nox.options.reuse_existing_virtualenvs is currently enabled, which is appropriate for local developer workflows (where re-using virtualenvs speeds up iteration) but is undesirable in CI where clean, reproducible environments are required for every build. Additionally, the CI pipeline does not yet run different test suites in parallel across multiple machines, and test artifacts such as coverage reports and test results are not cached between builds.

Expected Behavior

  • nox.options.reuse_existing_virtualenvs is disabled in CI so that each build starts from a clean virtualenv.
  • The CI pipeline is configured to run test suites in parallel across multiple machines where possible.
  • Test artifacts (coverage reports, test results) are cached in the CI pipeline to speed up subsequent builds.
  • Overall CI build time is reduced.

Acceptance Criteria

  • nox.options.reuse_existing_virtualenvs is set to False (or unset) when running in CI (e.g., gated on a CI environment variable).
  • The CI workflow (.forgejo/workflows/ci.yml) distributes test suites across parallel jobs or machines.
  • Coverage reports and test result artifacts are uploaded and cached between CI runs.
  • The overall wall-clock build time is measurably reduced compared to the baseline.

Supporting Information

  • Related Epic: #1678 (CI Execution Time Optimization)
  • See also: noxfile.py at project root, .forgejo/workflows/ci.yml
  • CONTRIBUTING.md requires all nox stages pass and coverage ≥ 97%

Subtasks

  • Disable nox.options.reuse_existing_virtualenvs in CI (gate on CI env var) in noxfile.py
  • Investigate and implement running different test suites in parallel across multiple machines in .forgejo/workflows/ci.yml
  • Configure the CI pipeline to cache test artifacts (coverage reports, test results) between builds
  • Update features/ci_workflow_validation.feature to assert the new noxfile CI behaviour and artifact caching steps
  • Tests (Behave): Add/update scenarios covering the noxfile CI optimizations
  • Verify coverage ≥ 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • nox.options.reuse_existing_virtualenvs is disabled in CI environments.
  • The CI pipeline is configured to run test suites in parallel across multiple machines.
  • Test artifacts are cached in the CI pipeline.
  • The overall build time is reduced.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (chore(ci): optimize noxfile.py for CI environments), followed by a blank line, then additional lines providing relevant implementation details.
  • The commit is pushed to the remote on the branch chore/ci-optimize-noxfile-for-ci.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: ca-new-issue-creator

## Metadata - **Branch**: `chore/ci-optimize-noxfile-for-ci` - **Commit Message**: `chore(ci): optimize noxfile.py for CI environments` - **Milestone**: v3.8.0 - **Parent Epic**: #1678 ## Background and Context The current `noxfile.py` is well-suited for local development, but it could be further optimized for CI environments. Specifically, `nox.options.reuse_existing_virtualenvs` is currently enabled, which is appropriate for local developer workflows (where re-using virtualenvs speeds up iteration) but is undesirable in CI where clean, reproducible environments are required for every build. Additionally, the CI pipeline does not yet run different test suites in parallel across multiple machines, and test artifacts such as coverage reports and test results are not cached between builds. ## Expected Behavior - `nox.options.reuse_existing_virtualenvs` is disabled in CI so that each build starts from a clean virtualenv. - The CI pipeline is configured to run test suites in parallel across multiple machines where possible. - Test artifacts (coverage reports, test results) are cached in the CI pipeline to speed up subsequent builds. - Overall CI build time is reduced. ## Acceptance Criteria - `nox.options.reuse_existing_virtualenvs` is set to `False` (or unset) when running in CI (e.g., gated on a `CI` environment variable). - The CI workflow (`.forgejo/workflows/ci.yml`) distributes test suites across parallel jobs or machines. - Coverage reports and test result artifacts are uploaded and cached between CI runs. - The overall wall-clock build time is measurably reduced compared to the baseline. ## Supporting Information - Related Epic: #1678 (CI Execution Time Optimization) - See also: `noxfile.py` at project root, `.forgejo/workflows/ci.yml` - CONTRIBUTING.md requires all nox stages pass and coverage ≥ 97% ## Subtasks - [ ] Disable `nox.options.reuse_existing_virtualenvs` in CI (gate on `CI` env var) in `noxfile.py` - [ ] Investigate and implement running different test suites in parallel across multiple machines in `.forgejo/workflows/ci.yml` - [ ] Configure the CI pipeline to cache test artifacts (coverage reports, test results) between builds - [ ] Update `features/ci_workflow_validation.feature` to assert the new noxfile CI behaviour and artifact caching steps - [ ] Tests (Behave): Add/update scenarios covering the noxfile CI optimizations - [ ] Verify coverage ≥ 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - `nox.options.reuse_existing_virtualenvs` is disabled in CI environments. - The CI pipeline is configured to run test suites in parallel across multiple machines. - Test artifacts are cached in the CI pipeline. - The overall build time is reduced. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`chore(ci): optimize noxfile.py for CI environments`), followed by a blank line, then additional lines providing relevant implementation details. - The commit is pushed to the remote on the branch `chore/ci-optimize-noxfile-for-ci`. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.8.0 milestone 2026-04-02 23:36:31 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: MoSCoW/Could Have — CI/test infrastructure improvement. Could Have.

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: MoSCoW/Could Have — CI/test infrastructure improvement. Could Have. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#1723
No description provided.