Commit daffe498 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

tests/frontend/workspace.py: Exercise the build test in strict and non-strict mode

This test fails without the previous patch fixing issue #316,
so this should guard against regressions of building and caching
workspace builds in non-strict mode.
parent 9012a5ed
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -196,7 +196,8 @@ def test_list(cli, tmpdir, datafiles):

@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("kind", repo_kinds)
def test_build(cli, tmpdir, datafiles, kind):
@pytest.mark.parametrize("strict", [("strict"), ("non-strict")])
def test_build(cli, tmpdir, datafiles, kind, strict):
    element_name, project, workspace = open_workspace(cli, tmpdir, datafiles, kind, False)
    checkout = os.path.join(str(tmpdir), 'checkout')

@@ -206,6 +207,18 @@ def test_build(cli, tmpdir, datafiles, kind):
    with open(os.path.join(workspace, 'etc', 'pony.conf'), 'w') as f:
        f.write("PONY='pink'")

    # Configure strict mode
    strict_mode = True
    if strict != 'strict':
        strict_mode = False
    cli.configure({
        'projects': {
            'test': {
                'strict': strict_mode
            }
        }
    })

    # Build modified workspace
    assert cli.get_element_state(project, element_name) == 'buildable'
    assert cli.get_element_key(project, element_name) == "{:?<64}".format('')