diff --git a/extensions/commands/art/cmd_build_info.py b/extensions/commands/art/cmd_build_info.py index 61e94e8..984b7e0 100644 --- a/extensions/commands/art/cmd_build_info.py +++ b/extensions/commands/art/cmd_build_info.py @@ -186,7 +186,12 @@ def get_artifacts(self, node, artifact_type, is_dependency=False): assert artifact_type in ["recipe", "package"] if artifact_type == "recipe": - artifacts_names = ["conan_sources.tgz", "conan_export.tgz", "conanfile.py", "conanmanifest.txt"] + artifacts_names = ["conanfile.py", "conanmanifest.txt"] + reference = RecipeReference.loads(node.get("ref")) + export_path = self._conan_api.cache.export_path(reference) + if set(os.listdir(export_path)) != set(artifacts_names): # Check if recipe has additional exports files + artifacts_names.append("conan_export.tgz") + artifacts_names.append("conan_sources.tgz") else: artifacts_names = ["conan_package.tgz", "conaninfo.txt", "conanmanifest.txt"] diff --git a/tests/test_build_info.py b/tests/test_build_info.py index 95620fd..ee864a0 100644 --- a/tests/test_build_info.py +++ b/tests/test_build_info.py @@ -204,13 +204,13 @@ def test_formatted_time(): def test_missing_files_warning(): """ - Test that a warning is issued when .tgz files are missing from the build-info JSON + Test that there are no warnings about missing .tgz files """ run("conan new header_lib -d name=lib1 -d version=1.0") run("conan create . -f json > create.json") graph = json.loads(load("create.json"))["graph"] _fake_conan_sources(graph) + run("conan upload lib1/1.0 -r conancenter --dry-run") # Simulate upload to generate the expected .tgz files out = run("conan art:build-info create create.json build_name 1 repo --with-dependencies > bi.json") - assert "WARN: There are missing .tgz files (conan_export.tgz)" in out - assert "WARN: There are missing .tgz files (conan_package.tgz)" in out + assert not "WARN: There are missing .tgz files" in out