diff options
author | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-26 13:44:01 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-26 13:44:01 +0000 |
commit | a9adb480eb9b2c59f5b32a9bd4576867bafe8889 (patch) | |
tree | d5f5fbedab1a489b1432f4f5e8250b7d580d65ed /tests/frontend/show.py | |
parent | 737fbaca671140a1e1a6eb8bbcb01ed9bbc3fb21 (diff) | |
parent | df8af303f286a0c4f1c4be9c61fd049543d1de2c (diff) | |
download | buildstream-fetch-committers.tar.gz |
Merge branch 'jonathan/job-progress' into 'master'fetch-committers
Render progress information for loading and processing elements
See merge request BuildStream/buildstream!1482
Diffstat (limited to 'tests/frontend/show.py')
-rw-r--r-- | tests/frontend/show.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/frontend/show.py b/tests/frontend/show.py index d173fd80a..0aa720681 100644 --- a/tests/frontend/show.py +++ b/tests/frontend/show.py @@ -40,6 +40,16 @@ def test_show(cli, datafiles, target, fmt, expected): .format(expected, result.output)) +@pytest.mark.datafiles(os.path.join(DATA_DIR, 'project')) +def test_show_progress_tally(cli, datafiles): + # Check that the progress reporting messages give correct tallies + project = str(datafiles) + result = cli.run(project=project, args=['show', 'compose-all.bst']) + result.assert_success() + assert " 3 subtasks processed" in result.stderr + assert "3 of 3 subtasks processed" in result.stderr + + @pytest.mark.datafiles(os.path.join( os.path.dirname(os.path.realpath(__file__)), "invalid_element_path", @@ -387,6 +397,40 @@ def test_fetched_junction(cli, tmpdir, datafiles, element_name, workspaced): assert 'junction.bst:import-etc.bst-buildable' in results +@pytest.mark.datafiles(os.path.join(DATA_DIR, 'project')) +def test_junction_tally(cli, tmpdir, datafiles): + # Check that the progress reporting messages count elements in junctions + project = str(datafiles) + subproject_path = os.path.join(project, 'files', 'sub-project') + junction_path = os.path.join(project, 'elements', 'junction.bst') + element_path = os.path.join(project, 'elements', 'junction-dep.bst') + + # Create a repo to hold the subproject and generate a junction element for it + generate_junction(tmpdir, subproject_path, junction_path, store_ref=True) + + # Create a stack element to depend on a cross junction element + # + element = { + 'kind': 'stack', + 'depends': [ + { + 'junction': 'junction.bst', + 'filename': 'import-etc.bst' + } + ] + } + _yaml.roundtrip_dump(element, element_path) + + result = cli.run(project=project, silent=True, args=[ + 'source', 'fetch', 'junction.bst']) + result.assert_success() + + # Assert the correct progress tallies are in the logging + result = cli.run(project=project, args=['show', 'junction-dep.bst']) + assert " 2 subtasks processed" in result.stderr + assert "2 of 2 subtasks processed" in result.stderr + + ############################################################### # Testing recursion depth # ############################################################### |