MilesCranmer commited on
Commit
c48a68e
1 Parent(s): 2be448f

Try to get coverage working in subprocesses

Browse files
Files changed (2) hide show
  1. .coveragerc +3 -0
  2. .github/workflows/CI.yml +5 -4
.coveragerc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [run]
2
+ omit =
3
+ */test/*
.github/workflows/CI.yml CHANGED
@@ -69,20 +69,21 @@ jobs:
69
  run: python3 -c "from pysr import jl; assert jl.VERSION.major == jl.seval('v\"${{ matrix.julia-version }}\"').major; assert jl.VERSION.minor == jl.seval('v\"${{ matrix.julia-version }}\"').minor"
70
  - name: "Install Coverage tool"
71
  run: pip install coverage coveralls
 
 
72
  - name: "Run tests"
73
- run: |
74
- coverage run --source=pysr --omit='*/test/*' -m pysr test main,cli,startup
75
  - name: "Install JAX"
76
  run: pip install jax jaxlib # (optional import)
77
  if: ${{ matrix.test-id == 'main' }}
78
  - name: "Run JAX tests"
79
- run: coverage run --append --source=pysr --omit='*/test/*' -m pysr test jax
80
  if: ${{ matrix.test-id == 'main' }}
81
  - name: "Install Torch"
82
  run: pip install torch # (optional import)
83
  if: ${{ matrix.test-id == 'main' }}
84
  - name: "Run Torch tests"
85
- run: coverage run --append --source=pysr --omit='*/test/*' -m pysr test torch
86
  if: ${{ matrix.test-id == 'main' }}
87
  - name: "Coveralls"
88
  env:
 
69
  run: python3 -c "from pysr import jl; assert jl.VERSION.major == jl.seval('v\"${{ matrix.julia-version }}\"').major; assert jl.VERSION.minor == jl.seval('v\"${{ matrix.julia-version }}\"').minor"
70
  - name: "Install Coverage tool"
71
  run: pip install coverage coveralls
72
+ - name: "Set up coverage for subprocesses"
73
+ run:
74
  - name: "Run tests"
75
+ run: COVERAGE_PROCESS_START="${PWD}/.coveragerc" coverage run --source=pysr -m pysr test main,cli,startup
 
76
  - name: "Install JAX"
77
  run: pip install jax jaxlib # (optional import)
78
  if: ${{ matrix.test-id == 'main' }}
79
  - name: "Run JAX tests"
80
+ run: COVERAGE_PROCESS_START="${PWD}/.coveragerc" coverage run --append --source=pysr -m pysr test jax
81
  if: ${{ matrix.test-id == 'main' }}
82
  - name: "Install Torch"
83
  run: pip install torch # (optional import)
84
  if: ${{ matrix.test-id == 'main' }}
85
  - name: "Run Torch tests"
86
+ run: COVERAGE_PROCESS_START="${PWD}/.coveragerc" coverage run --append --source=pysr -m pysr test torch
87
  if: ${{ matrix.test-id == 'main' }}
88
  - name: "Coveralls"
89
  env: