This repository has been archived by the owner on Jun 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pinned tests are nice for reproducibility (#197)
* pinned tests are nice for reproducibility * Update pytest.yml * Update setup.py * less cmt in test * Revert "less cmt in test" This reverts commit f6dbb82. Co-authored-by: Tianyu Zhu <tz2263@columbia.edu>
- Loading branch information
1 parent
e20831f
commit 12f5ca6
Showing
6 changed files
with
163 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Set update schedule for GitHub Actions to check they are up to date | ||
# If one of the github actions is out of date, dependabot will open a | ||
# PR to update the version of that action | ||
|
||
version: 2 | ||
updates: | ||
# Maintain the requirements in the github actiuons | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every weekday | ||
interval: "monthly" | ||
assignees: | ||
- jorana | ||
# Maintain the requirements requirements folder | ||
- package-ecosystem: "pip" | ||
directory: "/extra_requirements" | ||
schedule: | ||
# Check for updates to requirements every week | ||
interval: "monthly" | ||
open-pull-requests-limit: 10 | ||
assignees: | ||
- jorana |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Test straxen on each PR. | ||
# We run three types of tests: | ||
# - Pytest -> these are the "normal" tests and should be run for all | ||
# python versions | ||
# - Coveralls -> this is to see if we are coverering all our lines of | ||
# code with our tests. The results get uploaded to | ||
# coveralls.io/github/XENONnT/straxen | ||
# - pytest_no_database -> we want to make sure we can run the tests even | ||
# if we don't have access to our datebase since this will e.g. happen | ||
# when someone is pushing a PR from their own fork as we don't | ||
# propagate our secrets there. | ||
|
||
name: Test package | ||
|
||
# Trigger this code when a new release is published | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [created] | ||
pull_request: | ||
branches: | ||
- master | ||
- stable | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
update: | ||
name: "${{ matrix.test }}_py${{ matrix.python-version }}" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: True | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9] | ||
test: ['coveralls', 'pytest', 'pytest_no_database'] | ||
# Only run coverage / no_database on py3.8 | ||
exclude: | ||
- python-version: 3.7 | ||
test: coveralls | ||
- python-version: 3.9 | ||
test: coveralls | ||
- python-version: 3.7 | ||
test: pytest_no_database | ||
- python-version: 3.9 | ||
test: pytest_no_database | ||
steps: | ||
# Setup and installation | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Install requirements for tests and latest strax | ||
run: | | ||
pip install -r extra_requirements/requirements-tests.txt | ||
# Secrets and required files | ||
- name: patch utilix file | ||
# Patch this file if we want to have access to the database | ||
if: matrix.test != 'pytest_no_database' | ||
run: bash .github/scripts/create_readonly_utilix_config.sh | ||
env: | ||
# RunDB | ||
RUNDB_API_URL: ${{ secrets.RUNDB_API_URL }} | ||
RUNDB_API_USER_READONLY: ${{ secrets.RUNDB_API_USER_READONLY }} | ||
RUNDB_API_PASSWORD_READONLY: ${{ secrets.RUNDB_API_PASSWORD_READONLY}} | ||
PYMONGO_URL: ${{ secrets.PYMONGO_URL }} | ||
PYMONGO_USER: ${{ secrets.PYMONGO_USER }} | ||
PYMONGO_PASSWORD: ${{ secrets.PYMONGO_PASSWORD }} | ||
PYMONGO_DATABASE: ${{ secrets.PYMONGO_DATABASE }} | ||
# SCADA | ||
SCADA_URL: ${{ secrets.SCADA_URL }} | ||
SCADA_VALUE_URL: ${{ secrets.SCADA_VALUE_URL }} | ||
SCADA_USER: ${{ secrets.SCADA_USER }} | ||
SCADA_LOGIN_URL: ${{ secrets.SCADA_LOGIN_URL }} | ||
SCADA_PWD: ${{ secrets.SCADA_PWD }} | ||
|
||
# Run tests | ||
- name: Test package | ||
# This is running a normal test | ||
if: matrix.test == 'pytest_no_database' || matrix.test == 'pytest' | ||
run: | | ||
python setup.py test -v | ||
- name: Coveralls | ||
# Make the coverage report and upload | ||
env: | ||
NUMBA_DISABLE_JIT: 1 | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# We need to check if we had access to the secrets, otherwise coveralls | ||
# will yield a low coverage because of the lack of interfacing with the | ||
# database. | ||
HAVE_ACCESS_TO_SECTETS: ${{ secrets.RUNDB_API_URL }} | ||
if: matrix.test == 'coveralls' && env.HAVE_ACCESS_TO_SECTETS != null | ||
run: | | ||
coverage run --source=wfsim setup.py test -v | ||
coveralls --service=github | ||
# Done | ||
- name: goodbye | ||
run: echo "tests done, bye bye" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Test compatibility with these most often: | ||
strax==0.16.1 | ||
straxen==0.19.3 | ||
|
||
# File for the requirements of straxen with the automated tests | ||
blosc==1.10.4 # Strax dependency | ||
boltons==21.0.0 | ||
datashader==0.13.0 | ||
dask==2021.7.2 | ||
dill==0.3.4 # Strax dependency | ||
coveralls==3.2.0 | ||
commentjson==0.9.0 | ||
coverage==5.5 | ||
flake8==3.9.2 | ||
holoviews==1.14.5 | ||
ipywidgets==7.6.3 | ||
hypothesis==6.14.5 | ||
jupyter-client==6.1.12 # for ipywidgets | ||
matplotlib==3.4.2 | ||
multihist==0.6.4 | ||
npshmex==0.2.1 # Strax dependency | ||
numba==0.53.1 # Strax dependency | ||
numpy==1.19.5 | ||
pandas==1.2.5 # Strax dependency | ||
psutil==5.8.0 # Strax dependency | ||
pytest==6.2.4 | ||
pytest-cov==2.12.1 | ||
scikit-learn==0.24.2 | ||
scipy==1.7.0 # Strax dependency | ||
tensorflow==2.5.1 | ||
tqdm==4.62.0 | ||
xarray==0.19.0 | ||
utilix==0.6.1 | ||
zstd==1.5.0.2 # Strax dependency | ||
uproot==4.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters