-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract TestFrameworkCommon Project, remove dependency of TestFramework from FT #4346
Extract TestFrameworkCommon Project, remove dependency of TestFramework from FT #4346
Conversation
…work project from Functional.Test project
var v2Indices = v2.GetIndices(); | ||
for (; ; ) | ||
{ | ||
int iv1 = v1.IsDense ? iiv1 : iiv1 < v2Indices.Length ? v1Indices[iiv1] : v1.Length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v2Indices [](start = 53, length = 9)
Seems like a bug to me, should be v1Indices #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Yes, it does appear to be a bug. Can you please check the callers who are using this function and how those tests are passing?
In reply to: 336252686 [](ancestors = 336252686)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestEntryPoints class is using this method, these tests will pass as long as v1 and v2 has same indices length, this happens to be true in these tests
In reply to: 336584593 [](ancestors = 336584593,336252686)
Codecov Report
@@ Coverage Diff @@
## master #4346 +/- ##
=========================================
Coverage ? 74.7%
=========================================
Files ? 885
Lines ? 155046
Branches ? 16903
=========================================
Hits ? 115833
Misses ? 34493
Partials ? 4720
|
<!--<PackageReference Include="Microsoft.ML" Version="1.3.1" /> | ||
<PackageReference Include="Microsoft.ML.Ensemble" Version="0.15.1" /> | ||
<PackageReference Include="Microsoft.ML.FastTree" Version="1.3.1" />--> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing this is no longer needed? If not, can you please delete it? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CheckSameSchemas(data1.Schema, data3.Schema); | ||
CheckSameSchemas(data1.Schema, data4.Schema); | ||
CheckSameSchemas(data1.Schema, data5.Schema); | ||
CommonUtilities.CheckSameSchemas(data1.Schema, data2.Schema); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CommonUtilities [](start = 12, length = 15)
Does CommonUtilities sounds a bit too generic as a name? How about TestCommon or TestUtilities? I would appreciate it if another reviewer can chime in on this on whether this needs to be changed or okay as is. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
private static void Fail(bool relax, string fmt, params object[] args) | ||
{ | ||
Log("*** Failure: " + fmt, args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't fail the test. Instead of Fail
we should use the Assert
class in xunit. #Resolved
return f; | ||
} | ||
|
||
[Conditional("DEBUG")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why we have these methods. These are tests, you should use the Assert
class in xunit. If any conditions fail, it should fail the test, no matter if this is DEBUG or not. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is copied from Contracts Utilities class and this is also widely used in our test project like below, so are these also abuse and should be fixed?
protected bool EqualTypes(DataViewType type1, DataViewType type2, bool exactTypes)
{
Contracts.AssertValue(type1);
Contracts.AssertValue(type2);
return exactTypes ? type1.Equals(type2) : type1.SameSizeAndItemType(type2);
}
In reply to: 337248885 [](ancestors = 337248885)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just Assert.IsNotNull
instead of Contracts.AssertValue
#Resolved
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<NativeAssemblyReference Include="LdaNative" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe these add any value, since we never actually execute the TestFrameworkCommon project. These NativeAssemblyReference
are only necessary for projects that get executed (like real test projects).
You can remove this whole ItemGroup. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks, will remove these.
Copied these from TestFramework project, then I realized there are some tests in TestFramework and TestFramework project needs these, but sounds like TestFramework project shouldn't have any real test cases to me?
In reply to: 337707632 [](ancestors = 337707632)
{ | ||
public static class TestCommon | ||
{ | ||
public static string GetOutputPath(string name, string outDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems backwards to me. Shouldn't outDir
go before name
? Just like how Path.Combine(outDir, name)
does? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frank-dong-ms Thanks and looks good to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a. Extract CommonUtilities method, move some utilities from BaseTestClass to CommonUtilities
b. Move some test attributes from TestFramework to TestFrameworkCommon
c. Move TestDataset from TestFramework to TestFrameworkCommon and fix corresponding
reference
d. Move some schema compare method from TestDataPipeBase to CommonUtilities
e. TestFrameworkCommon only have public dependency, no internal class dependency
a. Remove dependency of TestFramework from FT, now FT dependent on TestFrameworkCommon
b. Remove unnecessary dependency of Maml from FT
a. Remove duplicate CompareVec method from CoreBaseTestClass, TestDataPipeBase and
CopyColumnEstimatorTests, move CompareVec method to CommonUtilities and fix reference
b. Fix bug in CompareVec method from CoreBaseTestClass class, original line 125 seems problematic.