-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
BinaryFormatter tests should be skipped only on AOT, WASM and Mobile #106858
Conversation
…e it's not supported by design
Tagging subscribers to this area: @dotnet/area-system-runtime |
…s in the root Directory.Build.props file)
…were being skipped for a while)
The initial change I’ve sent with this PR has allowed me to discover that there were 19 projects where BF-related tests were skipped since #103255 was merged. @ericstj I’ve re-enabled those tests by adding a project reference similar to what you did in #106737. We don’t want to run these tests on Mobile, WASM and NativeAOT (not supported by design). How adding such project reference is going to affect the build time for those configurations? Should we somehow make it conditional? If so, should we introduce an MSBuild property (or any other setting) and handle all that logic is some @bartonjs There are 5
|
If I did, I have no recollection of it. The BF compat package is just BF. Nothing should be different between using it in 9 and using BF in 8. |
It shouldn't add any time to a root level build. This project already builds and it will continue to only build once - MSBuild will get the cached value. As for leaf builds of individual projects - it will increase the time, however if folks want to avoid that they can always pass I wonder if we really want to have all these binary-formatter tests spread across the repo. Maybe we should consolidate them to limit the number of tests that use the OOB? |
// Assembly versions beyond 8.1 are the fully functional version from NuGet. | ||
// Assembly versions before 8.1 probably won't be encountered, since that's the past. | ||
|
||
if (assemblyVersion.Major == 8 && assemblyVersion.Minor == 1) |
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 you're taking the assembly version logic out.
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 you're taking the assembly version logic out.
Because it has hidden the fact that 19 projects were using the "throwing" version of BF (the tests were always skipped so any test failures would go unnoticed). With this change such tests are going to throw if they reference the wrong version.
…t is mapped to StringEqualityComparer, but serialized as GenericEqualityComparer<string>
@bartonjs you were right, the failures were caused by changes from #104202. I've fixed them, the tests should now pass. The best explanation can be found here: runtime/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.cs Lines 277 to 295 in c05e9d1
|
I like this idea, but due to time constraints I would prefer to do it after we ship 9. Is that acceptable? |
…otnet#106858) * respect AppContext switch (which is currently enabled for all projects in the root Directory.Build.props file) * add project reference to all test projects that need working BF (and were being skipped for a while) * adjust to changes from dotnet#104202: EqualityComparer<string>.Default is mapped to StringEqualityComparer, but serialized as GenericEqualityComparer<string>
…106858) * respect AppContext switch (which is currently enabled for all projects in the root Directory.Build.props file) * add project reference to all test projects that need working BF (and were being skipped for a while) * adjust to changes from #104202: EqualityComparer<string>.Default is mapped to StringEqualityComparer, but serialized as GenericEqualityComparer<string>
* Remove package references from library tests (#106737) * Remove package references from library tests These tests should be referencing the product assemblies so that they test latest and not old bits. * Reference the OOB version of SRSF and make sure it's copied * BinaryFormatter tests should be skipped only on AOT, WASM and Mobile (#106858) * respect AppContext switch (which is currently enabled for all projects in the root Directory.Build.props file) * add project reference to all test projects that need working BF (and were being skipped for a while) * adjust to changes from #104202: EqualityComparer<string>.Default is mapped to StringEqualityComparer, but serialized as GenericEqualityComparer<string> * Don't use WeakReferences in the round trip test, as the target may get freed in the meantime, fixes #104905 (#106967) * Enable more BinaryFormatter tests (#107408) * enable the BinaryFormatter tests in System.Runtime.Serialization.Formatters.Tests * add new test project, where the flag is disabled and it runs only 3 tests in total that ensure that * The SerializationGuard is no longer activated since BF was moved to the OOB package, the tests need to reflect that. * Disable binary formatter tests when DotNetBuildSourceOnly. (#107549) * [mono][tvos] Do not treat assembly.pdb/xml files as native files to bundle when AOTing on Helix (#107079) * Do not treat assembly.pdb/xml files as native files to bundle * Bundle satellite assemblies as well * [mono][ci] Include PDBs from runtime pack when building on Helix if required (#107348) --------- Co-authored-by: Eric StJohn <[email protected]> Co-authored-by: Tom Deseyn <[email protected]> Co-authored-by: Ivan Povazan <[email protected]>
…107903) * Remove package references from library tests (#106737) * Remove package references from library tests These tests should be referencing the product assemblies so that they test latest and not old bits. * Reference the OOB version of SRSF and make sure it's copied * BinaryFormatter tests should be skipped only on AOT, WASM and Mobile (#106858) * respect AppContext switch (which is currently enabled for all projects in the root Directory.Build.props file) * add project reference to all test projects that need working BF (and were being skipped for a while) * adjust to changes from #104202: EqualityComparer<string>.Default is mapped to StringEqualityComparer, but serialized as GenericEqualityComparer<string> * Don't use WeakReferences in the round trip test, as the target may get freed in the meantime, fixes #104905 (#106967) * Enable more BinaryFormatter tests (#107408) * enable the BinaryFormatter tests in System.Runtime.Serialization.Formatters.Tests * add new test project, where the flag is disabled and it runs only 3 tests in total that ensure that * The SerializationGuard is no longer activated since BF was moved to the OOB package, the tests need to reflect that. * Disable binary formatter tests when DotNetBuildSourceOnly. (#107549) * [mono][tvos] Do not treat assembly.pdb/xml files as native files to bundle when AOTing on Helix (#107079) * Do not treat assembly.pdb/xml files as native files to bundle * Bundle satellite assemblies as well * [mono][ci] Include PDBs from runtime pack when building on Helix if required (#107348) --------- Co-authored-by: Eric StJohn <[email protected]> Co-authored-by: Adam Sitnik <[email protected]> Co-authored-by: Tom Deseyn <[email protected]> Co-authored-by: Ivan Povazan <[email protected]>
…otnet#106858) * respect AppContext switch (which is currently enabled for all projects in the root Directory.Build.props file) * add project reference to all test projects that need working BF (and were being skipped for a while) * adjust to changes from dotnet#104202: EqualityComparer<string>.Default is mapped to StringEqualityComparer, but serialized as GenericEqualityComparer<string>
…otnet#106858) * respect AppContext switch (which is currently enabled for all projects in the root Directory.Build.props file) * add project reference to all test projects that need working BF (and were being skipped for a while) * adjust to changes from dotnet#104202: EqualityComparer<string>.Default is mapped to StringEqualityComparer, but serialized as GenericEqualityComparer<string>
A follow up to the discussion we have started at #106737