You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/10/10 05:40:17 UTC

[buildstream] 01/03: tests/frontend/buildcheckout.py: Remove element name tests from here

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/strict-element-names
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit d4dd918cbdc0f678348e7464f3a0ac7e8a0506ae
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Sun Oct 10 14:33:52 2021 +0900

    tests/frontend/buildcheckout.py: Remove element name tests from here
    
    This is the wrong place to be testing for invalid element names, we should
    be testing that in the format tests, not in the tests which have to do
    with build & checkout functionality.
---
 tests/frontend/buildcheckout.py                    | 54 ----------------------
 .../project/elements/invalid-chars-in-dep.bst      |  8 ----
 tests/frontend/project/elements/target2.bst        |  7 ---
 tests/frontend/project/project.conf                |  4 --
 4 files changed, 73 deletions(-)

diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index 6021ff0..9e615c6 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -170,60 +170,6 @@ def test_non_strict_checkout_uncached(datafiles, cli, tmpdir):
 
 
 @pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.parametrize("strict,hardlinks", [("non-strict", "hardlinks"),])
-def test_build_invalid_suffix(datafiles, cli, strict, hardlinks):
-    project = str(datafiles)
-
-    result = cli.run(project=project, args=strict_args(["build", "target.foo"], strict))
-    result.assert_main_error(ErrorDomain.LOAD, "bad-element-suffix")
-
-
-@pytest.mark.datafiles(DATA_DIR)
-@pytest.mark.parametrize("strict,hardlinks", [("non-strict", "hardlinks"),])
-def test_build_invalid_suffix_dep(datafiles, cli, strict, hardlinks):
-    project = str(datafiles)
-
-    # target2.bst depends on an element called target.foo
-    result = cli.run(project=project, args=strict_args(["build", "target2.bst"], strict))
-    result.assert_main_error(ErrorDomain.LOAD, "bad-element-suffix")
-
-
-@pytest.mark.skipif(IS_WINDOWS, reason="Not available on Windows")
-@pytest.mark.datafiles(DATA_DIR)
-def test_build_invalid_filename_chars(datafiles, cli):
-    project = str(datafiles)
-    element_name = "invalid-chars|<>-in-name.bst"
-
-    # The name of this file contains characters that are not allowed by
-    # BuildStream, using it should raise a warning.
-    element = {
-        "kind": "stack",
-    }
-    _yaml.roundtrip_dump(element, os.path.join(project, "elements", element_name))
-
-    result = cli.run(project=project, args=strict_args(["build", element_name], "non-strict"))
-    result.assert_main_error(ErrorDomain.LOAD, "bad-characters-in-name")
-
-
-@pytest.mark.skipif(IS_WINDOWS, reason="Not available on Windows")
-@pytest.mark.datafiles(DATA_DIR)
-def test_build_invalid_filename_chars_dep(datafiles, cli):
-    project = str(datafiles)
-    element_name = "invalid-chars|<>-in-name.bst"
-
-    # The name of this file contains characters that are not allowed by
-    # BuildStream, and is listed as a dependency of 'invalid-chars-in-dep.bst'.
-    # This should also raise a warning.
-    element = {
-        "kind": "stack",
-    }
-    _yaml.roundtrip_dump(element, os.path.join(project, "elements", element_name))
-
-    result = cli.run(project=project, args=strict_args(["build", "invalid-chars-in-dep.bst"], "non-strict"))
-    result.assert_main_error(ErrorDomain.LOAD, "bad-characters-in-name")
-
-
-@pytest.mark.datafiles(DATA_DIR)
 @pytest.mark.parametrize("deps", [("run"), ("none"), ("build"), ("all")])
 def test_build_checkout_deps(datafiles, cli, deps):
     project = str(datafiles)
diff --git a/tests/frontend/project/elements/invalid-chars-in-dep.bst b/tests/frontend/project/elements/invalid-chars-in-dep.bst
deleted file mode 100644
index 6a5ec30..0000000
--- a/tests/frontend/project/elements/invalid-chars-in-dep.bst
+++ /dev/null
@@ -1,8 +0,0 @@
-kind: stack
-description: |
-
-  This element itself has a valid name, but depends on elements that have
-  invalid names. This should also result in a warning.
-
-depends:
-- invalid-chars|<>-in-name.bst
diff --git a/tests/frontend/project/elements/target2.bst b/tests/frontend/project/elements/target2.bst
deleted file mode 100644
index 259819f..0000000
--- a/tests/frontend/project/elements/target2.bst
+++ /dev/null
@@ -1,7 +0,0 @@
-kind: stack
-description: |
-
-  Main stack target for the bst build test
-
-depends:
-- target.foo
diff --git a/tests/frontend/project/project.conf b/tests/frontend/project/project.conf
index c82f85b..5ba3168 100644
--- a/tests/frontend/project/project.conf
+++ b/tests/frontend/project/project.conf
@@ -2,7 +2,3 @@
 name: test
 min-version: 2.0
 element-path: elements
-
-fatal-warnings:
-- bad-element-suffix
-- bad-characters-in-name