Skip to content

Add workflow_test Pixi task for full local workflow/config matrix validation#50

Merged
maxnutz merged 2 commits intomainfrom
copilot/create-local-workflow-testing-pixi-task
Apr 23, 2026
Merged

Add workflow_test Pixi task for full local workflow/config matrix validation#50
maxnutz merged 2 commits intomainfrom
copilot/create-local-workflow-testing-pixi-task

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

This adds a local Pixi task to execute the full workflow/config matrix plus tests in one command, so contributors can quickly verify compatibility across all supported temporal and regional scalings.

  • Pixi task: full sequential workflow check

    • Added workflow_test under [tasks] in pixi.toml.
    • The task runs all required workflow CLI invocations in strict sequence, then runs the test suite command.
  • Coverage of required config combinations

    • config.country-timeseries.yaml
    • config.country-year.yaml
    • config.region-timeseries.yaml
    • config.region-year.yaml
    • followed by pytest tests/ -v
  • Regression guard for task definition

    • Added tests/test_pixi_tasks.py to assert workflow_test contains the exact required command list in order.
[tasks]
workflow_test = "python workflow.py --config pypsa_validation_processing/configs/config.country-timeseries.yaml && python workflow.py --config pypsa_validation_processing/configs/config.country-year.yaml && python workflow.py --config pypsa_validation_processing/configs/config.region-timeseries.yaml && python workflow.py --config pypsa_validation_processing/configs/config.region-year.yaml && pytest tests/ -v"

Summary by Sourcery

Add a Pixi task to run the full workflow configuration matrix followed by tests in a single command and guard it with a regression test.

New Features:

  • Introduce a workflow_test Pixi task that sequentially runs all supported workflow configurations and the test suite.

Tests:

  • Add a regression test to assert that the workflow_test Pixi task runs the expected commands in the correct order.

Copilot AI linked an issue Apr 23, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add local workflow testing pixi task Add workflow_test Pixi task for full local workflow/config matrix validation Apr 23, 2026
Copilot AI requested a review from maxnutz April 23, 2026 13:37
@maxnutz maxnutz marked this pull request as ready for review April 23, 2026 13:49
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a new Pixi task workflow_test that runs the full set of workflow configurations sequentially followed by the test suite, and introduces a regression test to ensure the task continues to invoke the expected command sequence in order.

Sequence diagram for Pixi workflow_test task execution

sequenceDiagram
    actor Developer
    participant Pixi
    participant workflow_py
    participant pytest_cli

    Developer->>Pixi: pixi run workflow_test
    Pixi->>workflow_py: python workflow.py --config pypsa_validation_processing/configs/config.country-timeseries.yaml
    workflow_py-->>Pixi: exit code
    Pixi->>workflow_py: python workflow.py --config pypsa_validation_processing/configs/config.country-year.yaml
    workflow_py-->>Pixi: exit code
    Pixi->>workflow_py: python workflow.py --config pypsa_validation_processing/configs/config.region-timeseries.yaml
    workflow_py-->>Pixi: exit code
    Pixi->>workflow_py: python workflow.py --config pypsa_validation_processing/configs/config.region-year.yaml
    workflow_py-->>Pixi: exit code
    Pixi->>pytest_cli: pytest tests/ -v
    pytest_cli-->>Pixi: test results
    Pixi-->>Developer: aggregated command results
Loading

Flow diagram for workflow_test Pixi task command chain

flowchart LR
    dev[Developer runs pixi run workflow_test]
    pixi[Pixi task workflow_test]
    cts[Run workflow.py with config.country-timeseries.yaml]
    cy[Run workflow.py with config.country-year.yaml]
    rts[Run workflow.py with config.region-timeseries.yaml]
    ry[Run workflow.py with config.region-year.yaml]
    tests[Run pytest tests/ -v]

    dev --> pixi
    pixi --> cts
    cts --> cy
    cy --> rts
    rts --> ry
    ry --> tests
Loading

File-Level Changes

Change Details Files
Introduce a Pixi task to run all required workflow configurations and tests in one command.
  • Add workflow_test task string under [tasks] that sequentially runs four workflow.py configurations using && and then executes pytest tests/ -v
  • Keep existing workflow and test tasks unchanged aside from the new addition
pixi.toml
Add a unit test to assert the workflow_test Pixi task runs the exact expected command list in order.
  • Load pixi.toml via tomllib using a path resolved relative to the tests directory
  • Extract the workflow_test command, split by &&, and assert the list of parts exactly matches the expected workflow and pytest invocations in order
tests/test_pixi_tasks.py

Assessment against linked issues

Issue Objective Addressed Explanation
#49 Add a Pixi task named workflow_test to pixi.toml.
#49 Configure the workflow_test Pixi task to execute, in sequence, all specified commands: the four python workflow.py --config ... invocations for country/region and timeseries/year configs, followed by pytest tests/ -v.

Possibly linked issues

  • #Create local workflow testing pixi task: The PR exactly implements the requested workflow_test Pixi task running all listed commands, plus a validation test.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The workflow_test task command is quite long and hard to scan; consider factoring the repeated python workflow.py --config ... invocations into a small wrapper script or separate Pixi task(s) so the config matrix is easier to maintain and extend.
  • The test currently depends on splitting the task string by the literal delimiter " && "; if Pixi’s task syntax changes or additional shell flags are needed this will become brittle, so you might instead assert the full string or introduce a simple parser/helper that encapsulates the command structure.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `workflow_test` task command is quite long and hard to scan; consider factoring the repeated `python workflow.py --config ...` invocations into a small wrapper script or separate Pixi task(s) so the config matrix is easier to maintain and extend.
- The test currently depends on splitting the task string by the literal delimiter `" && "`; if Pixi’s task syntax changes or additional shell flags are needed this will become brittle, so you might instead assert the full string or introduce a simple parser/helper that encapsulates the command structure.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Owner

@maxnutz maxnutz left a comment

Choose a reason for hiding this comment

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

Good work! Appoved!

@maxnutz maxnutz merged commit 9249253 into main Apr 23, 2026
2 checks passed
@maxnutz maxnutz deleted the copilot/create-local-workflow-testing-pixi-task branch April 23, 2026 13:56
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.

Create local workflow testing pixi task

2 participants