Skip to content

fix: benchmark.yml fails because tmp/ directory doesn't exist in CI #302

@endavis

Description

@endavis

Bug Description

The benchmark.yml workflow fails in CI because the tmp/ directory doesn't exist on the GitHub Actions runner. The step writes --benchmark-json=tmp/benchmark-results.json but never creates the directory first.

Steps to Reproduce

  1. Have benchmark.yml workflow trigger on a push or PR
  2. The "Run benchmarks" step fails with:
    pytest: error: argument --benchmark-json: can't open 'tmp/benchmark-results.json': [Errno 2] No such file or directory: 'tmp/benchmark-results.json'
    

Expected vs Actual Behavior

Expected: Benchmarks run and results are written to tmp/benchmark-results.json

Actual: pytest exits with code 4 because it can't open the output file (parent directory doesn't exist)

Proposed Fix

Add mkdir -p tmp before running pytest in the "Run benchmarks" step:

      - name: Run benchmarks
        run: |
          mkdir -p tmp
          uv run pytest tests/benchmarks/ \
            --benchmark-enable --benchmark-only \
            --benchmark-json=tmp/benchmark-results.json -v

Context

Found during InfraFoundry sync with pyproject-template (endavis/infrafoundry#284). Fixed downstream in endavis/infrafoundry#285.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageNeeds review and prioritization

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions