Skip to content

Commit

Permalink
Merge pull request #124 from mantidproject/running-ci-tests-on-ubuntu…
Browse files Browse the repository at this point in the history
…-latest

Change github workflow to choose which tests to run
  • Loading branch information
GuiMacielPereira authored Jul 22, 2024
2 parents 5910398 + 0c72219 commit 7cdcbe3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/pr_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: push

jobs:
test:
runs-on: self-hosted
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
Expand All @@ -16,7 +16,7 @@ jobs:

# Set up conda environnment
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.2.0
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
miniforge-variant: Mambaforge
Expand All @@ -27,27 +27,37 @@ jobs:
- name: Flake8
run: python -m flake8 --config=config.flake8

# Remove `export MANTIDPROPERTIES=$(pwd)/Mantid.user.properties` when updated to mantid > 6.8.0
- name: Install Git
run: mamba install -y git

- name: Install mvesuvio package
run: pip install .

# Runs Unit tests
- name: Check for analysis files changed
run: |
echo "analysis-changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^src/' && echo true || echo false)" >> $GITHUB_ENV
- name: Check for calibration files changed
run: |
echo "calibration-changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^tools/calibration_scripts/' && echo true || echo false)" >> $GITHUB_ENV
- name: Run mvesuvio Analysis Unit Tests
if: ${{ env.analysis-changed == 'true'}}
run: |
export MANTIDPROPERTIES=$(pwd)/Mantid.user.properties
python -m unittest discover -s ./tests/analysis/unit
# Runs System tests
- name: Run mvesuvio Analysis System Tests
if: ${{ env.analysis-changed == 'true'}}
run: |
python -m unittest discover -s ./tests/analysis/system
- name: Run mvesuvio Calibration Unit Tests
if: ${{ env.calibration-changed == 'true'}}
run: |
export MANTIDPROPERTIES=$(pwd)/Mantid.user.properties
python -m unittest discover -s ./tests/calibration/unit
- name: Run Vesuvio Calibration System Tests
if: ${{ env.calibration-changed == 'true'}}
run: |
python -m unittest discover -s ./tests/calibration/system
Expand Down
1 change: 0 additions & 1 deletion src/mvesuvio/analysis_reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import numpy as np
from mantid.simpleapi import *
from scipy import optimize

from .analysis_fitting import passDataIntoWS, replaceZerosWithNCP

# Format print output of arrays
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import scipy.constants

from mantid.simpleapi import CreateEmptyTableWorkspace, mtd


Expand Down Expand Up @@ -305,4 +304,4 @@ def _identify_invalid_spectra(peak_table, peak_centres, peak_centres_errors, spe
(np.absolute(peak_Lorentz_FWHM_errors) > np.absolute(peak_Lorentz_FWHM)) | \
(np.absolute(peak_Lorentz_Amp_errors) > np.absolute(peak_Lorentz_Amp)) | \
(np.absolute(peak_centres_errors) > np.absolute(peak_centres)))
return invalid_spectra
return invalid_spectra

0 comments on commit 7cdcbe3

Please sign in to comment.