Repository navigation
[MSBuildDeviceIntegration] Give each test a unique package name. - #5551
Merged
Merged
Conversation
radekdoulik
reviewed
Jan 27, 2021
dellis1972
force-pushed
the
uniquetst
branch
3 times, most recently
from
February 12, 2021 13:11
7ddd47a to
d757c07
Compare
dellis1972
marked this pull request as ready for review
February 12, 2021 13:12
dellis1972
requested review from
jonathanpeppers and
jonpryor
as code owners
February 12, 2021 13:12
Contributor
|
There's one current test failure in This "feels like" a possible "concurrent NuGet restore" scenario, and the declaring test fixture doesn't prevent that: Restarting the tests. |
jonpryor
reviewed
Feb 18, 2021
jonpryor
reviewed
Feb 18, 2021
dellis1972
force-pushed
the
uniquetst
branch
from
February 22, 2021 17:10
d757c07 to
0f4ba36
Compare
One of the problems we might see on CI is when two tests run at the same time on the same emulator. This can cause collisions and tests to fail because the app was changed while the test was running. Currently ALL of the tests user `UnnamedProject.UnnamedProject` as a package name. This means they overwrite each other. The commit introduces a new method `GeneratePackageName` which will auto generate a package name based on `com.xamarin.test<Test ID>` where `<Test ID>` is the value we get from `TestContext.CurrentContext.Test.ID`. We have to switch out the hyphens in the Test ID to get a valid package name, but it will be unique. The result will be each test will have its own package and install location. None of the tests will overwrite the others. Addition code has been put in place for test `TearDown` to ensure that the package is uninstalled. This is so we don't fill up the device and run out of disk space. From now on Device based tests should use the new method to set the `PackageName` property.
dellis1972
force-pushed
the
uniquetst
branch
from
February 24, 2021 10:02
795016c to
92c0337
Compare
Contributor
Author
|
/azp run |
|
Azure Pipelines failed to run 1 pipeline(s). |
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One of the problems we might see on CI is when two tests run at the same
time on the same emulator. This can cause collisions and tests to fail
because the app was changed while the test was running.
Currently ALL of the tests user
UnnamedProject.UnnamedProjectas apackage name. This means they overwrite each other.
The commit introduces a new system which will
auto generate a package name based on the test name itself.
We do this by using the
[CallerMethod]attribute to find outwhich method called the constructor of the
XamarinAndroidApplicationProject. This is then used to constructa unique (ish) package name in the form
This should stop collisions. As part of the process we also register each
packageName used with a static cache. We then uninstall those from the
device when the
OnTimeTearDownmethod is called. This means thedevice will be cleaned as groups of tests are run.