-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into base_plugin
- Loading branch information
Showing
11 changed files
with
237 additions
and
49 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,34 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -z "$RUNDB_API_URL" ] | ||
then | ||
cat > $HOME/.xenon_config <<EOF | ||
[basic] | ||
logging_level=debug | ||
[RunDB] | ||
rundb_api_url = $RUNDB_API_URL | ||
rundb_api_user = $RUNDB_API_USER_READONLY | ||
rundb_api_password = $RUNDB_API_PASSWORD_READONLY | ||
xent_url = $PYMONGO_URL | ||
xent_user = $PYMONGO_USER | ||
xent_password = $PYMONGO_PASSWORD | ||
xent_database = $PYMONGO_DATABASE | ||
pymongo_url = $PYMONGO_URL | ||
pymongo_user = $PYMONGO_USER | ||
pymongo_password = $PYMONGO_PASSWORD | ||
pymongo_database = $PYMONGO_DATABASE | ||
[scada] | ||
scdata_url = $SCADA_URL | ||
sclastvalue_url = $SCADA_VALUE_URL | ||
sclogin_url = $SCADA_LOGIN_URL | ||
straxen_username = $SCADA_USER | ||
straxen_password = $SCADA_PWD | ||
pmt_parameter_names = no_file_found | ||
EOF | ||
echo "YEAH boy, complete github actions voodoo now made you have access to our database!" | ||
else | ||
echo "You have no power here! Environment variables are not set, therefore no utilix file will be created" | ||
fi |
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 @@ | ||
# copied from https://github.com/XENONnT/straxen/blob/master/.github/workflows/pytest.yml | ||
# Test fuse 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 covering all our lines of | ||
# code with our tests. The results get uploaded to | ||
# coveralls.io/github/XENONnT/fuse | ||
|
||
name: Test package | ||
|
||
# Trigger this code when a new release is published | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
HAVE_ACCESS_TO_SECRETS: ${{ secrets.RUNDB_API_URL }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ "ubuntu-latest" ] | ||
python-version: [ "3.9", "3.10" ] | ||
test: [ 'coveralls', 'pytest' ] | ||
|
||
steps: | ||
# Setup and installation | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
# following https://github.com/NESTCollaboration/nestpy/blob/master/README.md | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pytest coverage coveralls | ||
git clone https://github.com/NESTCollaboration/nestpy.git | ||
cd nestpy | ||
git submodule update --init --recursive | ||
pip install . | ||
cd .. | ||
rm -rf nestpy | ||
- name: Start MongoDB | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: 4.4.1 | ||
|
||
- name: patch utilix file | ||
# Secrets and required files | ||
# Patch this file if we want to have access to the 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 }} | ||
|
||
- name: Install fuse | ||
run: | | ||
pip install . | ||
- name: Test package | ||
# This is running a normal test | ||
env: | ||
TEST_MONGO_URI: 'mongodb://localhost:27017/' | ||
run: | | ||
coverage run --source=fuse -m pytest --durations 0 | ||
coverage report | ||
- name: Coveralls | ||
# Make the coverage report and upload | ||
env: | ||
TEST_MONGO_URI: 'mongodb://localhost:27017/' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: matrix.test == 'coveralls' && env.HAVE_ACCESS_TO_SECRETS != null | ||
run: | | ||
coverage run --source=fuse -m pytest -v | ||
coveralls --service=github | ||
- name: goodbye | ||
run: echo "tests done, bye bye" |
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
|
||
fuse/__pycache__/* | ||
__pycache__ | ||
fuse.egg-info/* | ||
.eggs/* | ||
build/* | ||
.DS_Store | ||
.vscode/* | ||
docs/build/* | ||
tests/resource_cache/* | ||
resource_cache | ||
.coverage | ||
.hypothesis | ||
.DS_Store |
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
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
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
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
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 @@ | ||
test_root_file_name = 'test_cryo_neutrons_tpc-nveto.root' |
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
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
Oops, something went wrong.