diff --git a/targeting-packs-bad-files/test.json b/targeting-packs-bad-files/test.json index f0e5205..e4149b8 100644 --- a/targeting-packs-bad-files/test.json +++ b/targeting-packs-bad-files/test.json @@ -7,10 +7,6 @@ "type": "bash", "cleanup": true, "skipWhen": [ - "version=8", // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251 - "version=9", // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251 - "version=10", // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251 - "version=11" // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251 ], "ignoredRIDs":[ diff --git a/targeting-packs-bad-files/test.sh b/targeting-packs-bad-files/test.sh index 9fe2fe6..7145875 100755 --- a/targeting-packs-bad-files/test.sh +++ b/targeting-packs-bad-files/test.sh @@ -9,10 +9,22 @@ echo "Found .NET at $dotnet_dir" errors=0 -json_lines=$(find "$dotnet_dir/packs" -iname '*.json' | wc -l) -if [[ $json_lines -gt 0 ]]; then - echo "error: found some json files in $dotnet_dir/packs" - find "$dotnet_dir/packs" -iname '*.json' +# The SharedFramework SDK intentionally generates each runtime pack's framework +# .deps.json and .runtimeconfig.json at runtimes//lib/. +# See https://github.com/dotnet/arcade/pull/5714 +# Allow only those known files in that layout; other JSON files in packs are unexpected. +bad_json_files=() +while IFS= read -r -d '' json_file; do + relative_path=${json_file#"$dotnet_dir/packs/"} + if [[ ! $relative_path =~ ^Microsoft\.NETCore\.App\.Runtime(\.NativeAOT)?\.[^/]+/[^/]+/runtimes/[^/]+/lib/net[^/]+/Microsoft\.NETCore\.App\.(deps|runtimeconfig)\.json$ && + ! $relative_path =~ ^Microsoft\.AspNetCore\.App\.Runtime\.[^/]+/[^/]+/runtimes/[^/]+/lib/net[^/]+/Microsoft\.AspNetCore\.App\.(deps|runtimeconfig)\.json$ ]]; then + bad_json_files+=("$json_file") + fi +done < <(find "$dotnet_dir/packs" -iname '*.json' -print0) + +if [[ ${#bad_json_files[@]} -gt 0 ]]; then + echo "error: found unexpected json files in $dotnet_dir/packs" + printf '%s\n' "${bad_json_files[@]}" errors=1 fi