Skip to content
Snippets Groups Projects
Commit b94671aa authored by Johannes Schumann's avatar Johannes Schumann
Browse files

Merge branch 'update-ci' into 'master'

Update ci

See merge request !32
parents dd2e353d 426223eb
No related branches found
No related tags found
1 merge request!32Update ci
Pipeline #28476 failed
image: docker.km3net.de/base/singularity-py3:3.5.3
image: docker.km3net.de/base/python:3
variables:
GIT_SUBMODULE_STRATEGY: recursive
......@@ -37,11 +37,11 @@ reset_test_image:
.virtualenv_template: &virtualenv_definition |
python -V
export SETUPTOOLS_USE_DISTUTILS=stdlib
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -U pip setuptools yapf
if [ ! -f GiBUU.simg ]; then make buildremote; fi
make install-dev
pip list
date
......@@ -53,7 +53,7 @@ reset_test_image:
test:
image: docker.km3net.de/base/singularity-py3:3.5.3
image: python:3
stage: test
tags:
- docker
......@@ -63,7 +63,7 @@ test:
<<: *junit_definition
code-style:
image: docker.km3net.de/base/singularity-py3:3.5.3
image: python:3
stage: test
script:
- *virtualenv_definition
......@@ -71,7 +71,7 @@ code-style:
allow_failure: true
coverage:
image: docker.km3net.de/base/singularity-py3:3.5.3
image: python:3
stage: coverage
tags:
- docker
......@@ -116,7 +116,7 @@ release-image:
- tags
pages:
image: docker.km3net.de/base/python:3.6
image: docker.km3net.de/base/python:3
stage: doc
script:
- make install-dev
......
......@@ -32,7 +32,6 @@ path=/tmp/gseagen
class TestConfig(unittest.TestCase):
def setUp(self):
self.cfg_tmpfile = NamedTemporaryFile(delete=False)
self.mock_image_file = NamedTemporaryFile(delete=False)
......
......@@ -11,21 +11,24 @@ __email__ = "jschumann@km3net.de"
__status__ = "Development"
import csv
import pytest
import unittest
import numpy as np
from km3buu.jobcard import *
from km3buu.ctrl import run_jobcard
from tempfile import TemporaryDirectory, NamedTemporaryFile
from os import listdir
from os import listdir, environ
from os.path import abspath, join, dirname
from thepipe.logger import get_logger
from km3net_testdata import data_path
TESTDATA_DIR = data_path("gibuu")
GIBUU_INSTALL_AVAILABLE = environ.get("CONTAINER_GIBUU_EXEC") is not None
class TestCTRLbyJobcardFile(unittest.TestCase):
@pytest.mark.skipif(not GIBUU_INSTALL_AVAILABLE, reason="GiBUU not installed")
class TestCTRLbyJobcardFile(unittest.TestCase):
def setUp(self):
self.filename = join(TESTDATA_DIR, "km3net_testdata.job")
self.output_dir = TemporaryDirectory()
......@@ -48,8 +51,8 @@ class TestCTRLbyJobcardFile(unittest.TestCase):
assert "EventOutput.Pert.00000001.root" in files
@pytest.mark.skipif(not GIBUU_INSTALL_AVAILABLE, reason="GiBUU not installed")
class TestCTRLbyJobcardObject(unittest.TestCase):
def setUp(self):
log = get_logger("ctrl.py")
log.setLevel("INFO")
......
......@@ -19,7 +19,6 @@ from km3buu import DOCKER_URL, IMAGE_NAME
class TestBuild(unittest.TestCase):
def test_wrong_dir_path(self):
wrong_path = "foobar"
try:
......
......@@ -17,14 +17,12 @@ import numpy as np
class TestGeneralGeometry(unittest.TestCase):
def test_abstract_init(self):
with self.assertRaises(TypeError) as ctx:
d = DetectorVolume()
class TestSphere(unittest.TestCase):
def setUp(self):
self.detector_geometry = SphericalVolume(20, (2, 2, 2))
......@@ -46,7 +44,6 @@ class TestSphere(unittest.TestCase):
class TestCan(unittest.TestCase):
def setUp(self):
self.detector_geometry = CanVolume()
......
......@@ -12,15 +12,20 @@ __status__ = "Development"
import unittest
import numpy as np
import pytest
from os import environ
from itertools import combinations
from km3buu.jobcard import *
from km3buu.ctrl import run_jobcard
from km3buu.output import GiBUUOutput
from tempfile import TemporaryFile, TemporaryDirectory
GIBUU_INSTALL_AVAILABLE = environ.get("CONTAINER_GIBUU_EXEC") is not None
if GIBUU_INSTALL_AVAILABLE:
from km3buu.ctrl import run_jobcard
class TestJobcard(unittest.TestCase):
class TestJobcard(unittest.TestCase):
def setUp(self):
self.test_jobcard = Jobcard()
# Insert some test elements
......@@ -50,7 +55,6 @@ class TestJobcard(unittest.TestCase):
class TestNeutrinoEnergyRangeJobcard(unittest.TestCase):
def setUp(self):
self.test_fluxfile = TemporaryFile()
self.test_Z = np.random.randint(1, 100)
......@@ -101,7 +105,6 @@ class TestNeutrinoEnergyRangeJobcard(unittest.TestCase):
class TestNeutrinoSingleEnergyJobcard(unittest.TestCase):
def setUp(self):
self.test_fluxfile = TemporaryFile()
self.test_Z = np.random.randint(1, 100)
......@@ -135,8 +138,8 @@ class TestNeutrinoSingleEnergyJobcard(unittest.TestCase):
not self.photon_propagation_flag)
@pytest.mark.skipif(not GIBUU_INSTALL_AVAILABLE, reason="GiBUU not installed")
class TestJobcardSeed(unittest.TestCase):
def setUp(self):
jc = generate_neutrino_jobcard(100,
"CC",
......
......@@ -37,7 +37,6 @@ except ModuleNotFoundError:
class TestXSection(unittest.TestCase):
def test_xsection_all(self):
filename = join(TESTDATA_DIR, XSECTION_FILENAMES["all"])
xsection = read_nu_abs_xsection(filename)
......@@ -48,7 +47,6 @@ class TestXSection(unittest.TestCase):
class TestGiBUUOutput(unittest.TestCase):
def setup_class(self):
self.output = GiBUUOutput(TESTDATA_DIR)
......@@ -93,7 +91,6 @@ class TestGiBUUOutput(unittest.TestCase):
@pytest.mark.skipif(not KM3NET_LIB_AVAILABLE,
reason="KM3NeT dataformat required")
class TestOfflineFile(unittest.TestCase):
def setUp(self):
output = GiBUUOutput(TESTDATA_DIR)
datafile = NamedTemporaryFile(suffix=".root")
......@@ -148,7 +145,6 @@ class TestOfflineFile(unittest.TestCase):
@pytest.mark.skipif(not KM3NET_LIB_AVAILABLE,
reason="KM3NeT dataformat required")
class TestMultiFileOutput(unittest.TestCase):
def setUp(self):
output = GiBUUOutput(TESTDATA_DIR)
datafile = NamedTemporaryFile(suffix=".root")
......
......@@ -28,7 +28,6 @@ MUON_TESTFILE = join(dirname(__file__), "data/muon_range_seawater.txt")
class TestMuonRangeSeaWater(unittest.TestCase):
def setUp(self):
self.ref_values = np.loadtxt(MUON_TESTFILE).T
......@@ -40,7 +39,6 @@ class TestMuonRangeSeaWater(unittest.TestCase):
class TestVisEnergyParticle(unittest.TestCase):
def setUp(self):
with open(PARTICLE_TESTFILE, "r") as f:
tmp = f.readline()
......@@ -59,7 +57,6 @@ class TestVisEnergyParticle(unittest.TestCase):
class TestVisEnergyWeightFunctions(unittest.TestCase):
def setUp(self):
self.ref_values = np.loadtxt(FUNCTIONS_TESTFILE).T
......
......@@ -28,7 +28,6 @@ pp.RandomGenerator.get().set_seed(1234)
@pytest.mark.skip(reason="CI boost lib problem")
class TestTauPropagation(unittest.TestCase):
def setUp(self):
data = ak.Array({
"lepOut_E": [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment