[Xamarin.Android.Build.Tests] Fix Repeat Build Tests #2582
Merged
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.
PR #2515 highlighted an issue with a few of our
repeat build tests. Tests were failing because
the
_Sign
target was being skipped. Lookingat the build logs,
BuildApk
was being called.As was
_CreateBaseApk
, so what is going on?So it turns out that in
BuildApk
we use theCopyZipIfChanged
method to move the tempzip file over to the actual one. In this case
... the zip was identical! So the "new" zip
was not copied.. and so the
_Sign
task didnot need to run.
How can the zip be the same? It had an updated
file? Well wrong.. we just touched the timestamp.
In which case the zip ends up with the exact same
CRC values for each file. We use the CRC to detect
changes.. so no changes. So it turns out our build
system was behaving as expected.. it was just our
test was invalid.
So the fix here is to update the tests to make sure we
do change a file. This means the CRC's will change and
the targets will run.