diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index d21d62adb..eec5d51c0 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -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'] diff --git a/buildtest/cli/buildspec.py b/buildtest/cli/buildspec.py index 2253a467a..fa1b5d5b7 100644 --- a/buildtest/cli/buildspec.py +++ b/buildtest/cli/buildspec.py @@ -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!!!") diff --git a/buildtest/cli/cdash.py b/buildtest/cli/cdash.py index 665890e68..c5cccd639 100644 --- a/buildtest/cli/cdash.py +++ b/buildtest/cli/cdash.py @@ -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: - # '\n OK\n \n d41d8cd98f00b204e9800998ecf8427e\n\n' - if not re.search("OK", 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" diff --git a/pyproject.toml b/pyproject.toml index 71b408a73..46da94939 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/tests/cli/cdash_examples/invalid_project.yml b/tests/cli/cdash_examples/invalid_project.yml deleted file mode 100644 index b750ef0e5..000000000 --- a/tests/cli/cdash_examples/invalid_project.yml +++ /dev/null @@ -1,37 +0,0 @@ -system: - generic: - hostnames: - - .* - description: Generic System - moduletool: N/A - file_traversal_limit: 1000 - cdash: - url: "https://my.cdash.org" - project: INVALID-PROJECT - site: laptop - executors: - local: - bash: - description: submit jobs on local machine using bash shell - shell: bash - sh: - description: submit jobs on local machine using sh shell - shell: sh - csh: - description: submit jobs on local machine using csh shell - shell: csh - zsh: - description: submit jobs on local machine using zsh shell - shell: zsh - python: - description: submit jobs on local machine using python shell - shell: python - compilers: - find: - gcc: "^(gcc)" - compiler: - gcc: - builtin_gcc: - cc: /usr/bin/gcc - fc: /usr/bin/gfortran - cxx: /usr/bin/g++ diff --git a/tests/cli/cdash_examples/invalid_url.yml b/tests/cli/cdash_examples/invalid_url.yml index ee3dca5d9..fcf3d708a 100644 --- a/tests/cli/cdash_examples/invalid_url.yml +++ b/tests/cli/cdash_examples/invalid_url.yml @@ -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 diff --git a/tests/cli/test_cdash.py b/tests/cli/test_cdash.py index afe0c58bc..478346f08 100644 --- a/tests/cli/test_cdash.py +++ b/tests/cli/test_cdash.py @@ -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, @@ -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): + 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 - ) diff --git a/tests/cli/test_config.py b/tests/cli/test_config.py index f263eb8b6..40fa364ac 100644 --- a/tests/cli/test_config.py +++ b/tests/cli/test_config.py @@ -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, )