Skip to content
Snippets Groups Projects
Commit 692726de authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

feat(BSS-2): fail build_test if fails are found

parent 93c18642
No related branches found
No related tags found
1 merge request!498feat(BSS-2): fail build_test if fails are found
Pipeline #28725 canceled with stage
in 40 minutes and 54 seconds
......@@ -4,6 +4,8 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import unittest.mock
import sys
import xml.etree.ElementTree as ET
from spack import *
from spack.util.environment import EnvironmentModifications
......@@ -171,7 +173,18 @@ class Hxtorch(WafPackage):
def build_test(self):
self.builder.waf('build', '--test-execall')
copy_tree('build/test_results', join_path(self.prefix, '.build'))
copy_tree('build/test_results', join_path(self.prefix, ".build"))
copy_tree('build/test_results', join_path(self.stage.path, ".install_time_tests"))
# propagate failures from junit output to spack
tree = ET.parse('build/test_results/summary.xml')
for testsuite in tree.getroot():
for testcase in testsuite:
for elem in testcase:
if (elem.tag == 'failure') and not (
elem.get('message').startswith("pylint:") or
elem.get('message').startswith("pycodestyle:") or
("OK" in elem.get('message') and "Segmentation fault" in elem.get('message'))):
raise RuntimeError("Failed test found: {}".format(testcase.get('name')))
def install_args(self):
args = ['--test-execnone']
......
......@@ -4,6 +4,8 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import unittest.mock
import sys
import xml.etree.ElementTree as ET
from spack import *
from spack.util.environment import EnvironmentModifications
......@@ -170,7 +172,18 @@ class PynnBrainscales(WafPackage):
def build_test(self):
self.builder.waf('build', '--test-execall')
copy_tree('build/test_results', join_path(self.prefix, '.build'))
copy_tree('build/test_results', join_path(self.prefix, ".build"))
copy_tree('build/test_results', join_path(self.stage.path, ".install_time_tests"))
# propagate failures from junit output to spack
tree = ET.parse('build/test_results/summary.xml')
for testsuite in tree.getroot():
for testcase in testsuite:
for elem in testcase:
if (elem.tag == 'failure') and not (
elem.get('message').startswith("pylint:") or
elem.get('message').startswith("pycodestyle:") or
("OK" in elem.get('message') and "Segmentation fault" in elem.get('message'))):
raise RuntimeError("Failed test found: {}".format(testcase.get('name')))
def install_args(self):
args = ['--test-execnone']
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment