diff --git a/osbuild/main_cli.py b/osbuild/main_cli.py index 89d83e215..6a249df78 100644 --- a/osbuild/main_cli.py +++ b/osbuild/main_cli.py @@ -138,8 +138,9 @@ def osbuild_cli() -> int: exports = set(args.export) unresolved = [e for e in exports if e not in manifest] if unresolved: + available = list(manifest.pipelines.keys()) for name in unresolved: - print(f"Export {vt.bold}{name}{vt.reset} not found!") + print(f"Export {vt.bold}{name}{vt.reset} not found in {available}") print(f"{vt.reset}{vt.bold}{vt.red}Failed{vt.reset}") return 1 diff --git a/test/run/test_main.py b/test/run/test_main.py new file mode 100644 index 000000000..0b1c6778c --- /dev/null +++ b/test/run/test_main.py @@ -0,0 +1,24 @@ +import json + +import pytest + +from .. import test + +jsondata = json.dumps({ + "version": "2", + "pipelines": [ + { + "name": "noop", + }, + { + "name": "noop2", + }, + ], +}) + + +def test_exports_are_shown_on_missing_exports(capsys): + with pytest.raises(AssertionError): + with test.OSBuild() as osb: + osb.compile(jsondata, exports=["not-existing"]) + assert "Export not-existing not found in ['noop', 'noop2']\n" in capsys.readouterr().out