Closed gfabbris closed 3 years ago
Also, are you using a test framework, such as pytest? Might be easier to use tools within a test framework for this sort of setup.
Yes, it is using pytest. The one thing I changed (from apstools) was how to call pytest in the CI (below). But I think this is not the issue here.
in polartools:
- name: Run tests with pytest
run: |
source $CONDA/bin/activate $ENV_NAME
pytest
env:
PY_VER: ${{ matrix.python-version }}
ENV_NAME: anaconda-test-env-py-${{ matrix.python-version }}
In apstools:
- name: Run tests with pytest
run: |
source $CONDA/bin/activate $ENV_NAME
pytest -vvv ./tests ./apstools/beamtime/tests
env:
PY_VER: ${{ matrix.python-version }}
ENV_NAME: anaconda-test-env-py-${{ matrix.python-version }}
Can you databroker-unpack inplace {path} test_data
just before the source $CONDA/bin/activate $ENV_NAME
line and pick a path within the test environment directory to use? Or /tmp/test_data
, for example?
Good idea. This worked, but I had to run the databroker-unpack
after sourcing the environment, otherwise it can't find it.
It didn't work to use preparing a catalog to test
polartools.load_databroker
.See: https://github.com/APS-4ID-POLAR/polartools/blob/71b523180f866ac2668e503ae740a716c12d5136/polartools/tests/test_polartools.py#L13
From Pete: Use subprocess? https://github.com/APS-4ID-POLAR/polartools/commit/71b523180f866ac2668e503ae740a716c12d5136#r45253936