Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
buildtest_regtest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true

fail-fast: false
matrix:
os: [macos-latest, macos-13, ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
Expand Down
3 changes: 2 additions & 1 deletion buildtest/cli/buildspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,8 @@ def buildspec_validate_command(
console.print(f"[green]buildspec: {buildspec} is valid")

if exception_counter > 0:
console.print(f"[red]{exception_counter} buildspecs failed to validate")
msg = f"[red]{exception_counter} buildspecs failed to validate"
console.print(msg)
sys.exit(1)

console.print("[green]All buildspecs passed validation!!!")
Expand Down
13 changes: 3 additions & 10 deletions buildtest/cli/cdash.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,28 +128,21 @@ def upload_test_cdash(
project_name = configuration.target_config["cdash"]["project"]

if not build_name:
sys.exit("Please specify a buildname")
raise SystemExit("Please specify a buildname")

try:
requests.get(cdash_url)
except requests.ConnectionError:
except requests.exceptions.ConnectionError:
print(
"\nShown below is the CDASH settings from configuration file:",
configuration.file,
)
print(yaml.dump(configuration.target_config["cdash"], indent=2))
console.print_exception()
raise requests.ConnectionError
raise requests.exceptions.ConnectionError

upload_url = urljoin(cdash_url, f"submit.php?project={project_name}")

r = requests.get(upload_url)
# output of text property is the following:
# '<cdash version="3.0.3">\n <status>OK</status>\n <message></message>\n <md5>d41d8cd98f00b204e9800998ecf8427e</md5>\n</cdash>\n'
if not re.search("<status>OK</status>", r.text):
console.print("[red]Malformed XML, please check if project exist on CDASH!")
sys.exit(f"Invalid URL: {upload_url}")

# For best CDash results, builds names should be consistent (ie not change every time).

input_datetime_format = "%Y/%m/%d %H:%M:%S"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ split_on_trailing_comma = true

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-vra -x --durations=20 -vv"
addopts = "-vra --maxfail=5 --durations=20 -vv"
testpaths = ["tests"]
markers = [
"schema: run schema tests",
Expand Down
37 changes: 0 additions & 37 deletions tests/cli/cdash_examples/invalid_project.yml

This file was deleted.

11 changes: 10 additions & 1 deletion tests/cli/cdash_examples/invalid_url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ system:
hostnames:
- .*
description: Generic System
moduletool: N/A
moduletool: none
file_traversal_limit: 1000
buildspecs:
rebuild: false
count: 15
# specify format fields
#format: name,description
terse: false
report:
count: 25
format: name,id,state,runtime,returncode
cdash:
url: "https://my.cdash.XYZ.org"
project: buildtest
Expand Down
16 changes: 3 additions & 13 deletions tests/cli/test_cdash.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_cdash_upload():

def test_cdash_upload_exceptions():
# a buildname must be specified, a None will result in error

with pytest.raises(SystemExit):
upload_test_cdash(
build_name=None,
Expand All @@ -57,17 +58,6 @@ def test_cdash_upload_exceptions():
bc.detect_system()

# in configuration file we have invalid url to CDASH server
with pytest.raises(requests.ConnectionError):
# with pytest.raises(urllib3.exceptions.MaxRetryError):
Copy link

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented-out exception check for urllib3; it is no longer relevant and clutters the test.

Suggested change
# with pytest.raises(urllib3.exceptions.MaxRetryError):

Copilot uses AI. Check for mistakes.
with pytest.raises(requests.exceptions.ConnectionError):
upload_test_cdash(build_name="DEMO", configuration=bc)

bc = SiteConfiguration(
os.path.abspath(os.path.join(here, "cdash_examples", "invalid_project.yml"))
)
bc.detect_system()

# in configuration file we have invalid project name in CDASH

with pytest.raises(SystemExit):
upload_test_cdash(
build_name="DEMO", configuration=bc, site=None, open_browser=False
)
4 changes: 3 additions & 1 deletion tests/cli/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ def test_file_traversal_limit_in_config():
# exception can be raised when buildspec is invalid
with pytest.raises(SystemExit):
buildspec_validate_command(
buildspecs=[os.path.join(BUILDTEST_ROOT, "tutorials")],
buildspecs=[
os.path.join(BUILDTEST_ROOT, "tutorials", "invalid_executors.yml")
],
configuration=configuration,
)
Loading