Skip to content

Commit

Permalink
Fix: Fail to skip disabledmodel in winml (#17728)
Browse files Browse the repository at this point in the history
### Description
Move appending source name behind the ModifyNameIfDisabledTest

### Motivation and Context
In winml,  disabled test name doesn't include the model source name.
WinML job will be broken in the new image.

https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1151451&view=logs&s=4eef7ad1-5202-529d-b414-e2b14d056c05

### Verified

https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1151691&view=logs&s=4eef7ad1-5202-529d-b414-e2b14d056c05
  • Loading branch information
mszhanyi authored Sep 28, 2023
1 parent 1f4a352 commit 9136748
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions winml/test/model/model_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,6 @@ std::string GetFullNameOfTest(ITestCase* testCase, winml::LearningModelDeviceKin
name += tokenizedModelPath[tokenizedModelPath.size() - 2] += "_"; // model name
name += tokenizedModelPath[tokenizedModelPath.size() - 3]; // opset version

// To introduce models from model zoo, the model path is structured like this "<source>/<opset>/<model_name>/?.onnx"
std::string source = tokenizedModelPath[tokenizedModelPath.size() - 4];
// `models` means the root of models, to be ompatible with the old structure, that is, the source name is empty.
if (source != "models") {
name += "_" + source;
}

std::replace_if(
name.begin(), name.end(), [](char c) { return !absl::ascii_isalnum(c); }, '_'
);
Expand All @@ -405,6 +398,13 @@ std::string GetFullNameOfTest(ITestCase* testCase, winml::LearningModelDeviceKin
ModifyNameIfDisabledTest(/*inout*/ name, deviceKind);
}

// To introduce models from model zoo, the model path is structured like this "<source>/<opset>/<model_name>/?.onnx"
std::string source = tokenizedModelPath[tokenizedModelPath.size() - 4];
// `models` means the root of models, to be ompatible with the old structure, that is, the source name is empty.
if (source != "models") {
name += "_" + source;
}

return name;
}

Expand Down

0 comments on commit 9136748

Please sign in to comment.