Skip to content

Use direct URLs for test resources#7663

Open
ericstj wants to merge 2 commits into
dotnet:mainfrom
ericstj:fix/direct-test-resource-urls
Open

Use direct URLs for test resources#7663
ericstj wants to merge 2 commits into
dotnet:mainfrom
ericstj:fix/direct-test-resource-urls

Conversation

@ericstj

@ericstj ericstj commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

  • temporarily bypass deleted aka.ms/mlnet-resources aliases in tests
  • use direct public blob URLs for image and benchmark datasets
  • centralize bounded, retrying test downloads in TestDownloadUtils

Fixes #7662

Validation

  • rebuilt Microsoft.ML.TestFrameworkCommon, Microsoft.ML.AutoML.Tests, Microsoft.ML.TensorFlow.Tests, and Microsoft.ML.PerformanceTests
  • ran TensorFlowGettingSchemaMultipleTimes and AutoFeaturizer_image_test on net8.0

Temporarily bypass deleted aka.ms aliases for test datasets and centralize resilient direct downloads in the shared test framework.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 57cca22a-bb40-4b25-b169-1c9e46ae88e1
Copilot AI review requested due to automatic review settings July 16, 2026 20:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates ML.NET test infrastructure to bypass broken/deleted aka.ms/mlnet-resources aliases by switching tests/benchmarks to direct public URLs, and centralizes downloading logic into a shared helper to improve reliability.

Changes:

  • Added TestDownloadUtils to perform bounded, retrying downloads via a temp-file + atomic move pattern.
  • Updated TensorFlow and AutoML test datasets to download from direct mlpublicassets blob URLs.
  • Updated performance benchmarks to fetch datasets from either raw GitHub (repo test/data) or mlpublicassets benchmark blobs.
Show a summary per file
File Description
test/Microsoft.ML.TestFrameworkCommon/TestDownloadUtils.cs New shared download helper with retry + temp-file move semantics.
test/Microsoft.ML.TestFrameworkCommon/Microsoft.ML.TestFrameworkCommon.csproj Enables nullable annotations and links in RetryHelper for retries.
test/Microsoft.ML.TensorFlow.Tests/TensorflowTests.cs Replaces ResourceManagerUtils downloads with direct blob URLs + TestDownloadUtils.
test/Microsoft.ML.PerformanceTests/ImageClassificationBench.cs Switches dataset URL from aka.ms to direct blob URL.
test/Microsoft.ML.PerformanceTests/BenchmarkBase.cs Replaces resource manager downloads with direct URL downloads via TestDownloadUtils.
test/Microsoft.ML.AutoML.Tests/DatasetUtil.cs Switches dataset URL from aka.ms to direct blob URL.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 2

Comment thread test/Microsoft.ML.TestFrameworkCommon/TestDownloadUtils.cs
Comment thread test/Microsoft.ML.PerformanceTests/BenchmarkBase.cs Outdated
Validate response content length and remove the unused benchmark path local.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 57cca22a-bb40-4b25-b169-1c9e46ae88e1
@ericstj
ericstj enabled auto-merge (squash) July 16, 2026 21:11
@ericstj ericstj closed this Jul 17, 2026
auto-merge was automatically disabled July 17, 2026 02:03

Pull request was closed

@ericstj ericstj reopened this Jul 17, 2026
@ericstj
ericstj requested review from matouskozak and tarekgh July 17, 2026 02:04

@matouskozak matouskozak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for fixing this

string url;
if (path == "")
{
url = $"https://raw.githubusercontent.com/dotnet/machinelearning/main/test/data/{name.Replace('\\', '/')}";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward, do you think we might need to handle servicing release branches or is that not a concern in ML.NET? Just wondering if by taking data from main branch we might hit an issue later. Note, I haven't onboarded into the full release process so maybe this is not an issue at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Many test failures with System.IO.InvalidDataException : End of Central Directory record could not be found.

3 participants