Commit 7aaea22
authored
[tests] Be more flexible when parsing build-tools versions (#4354)
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3520928&view=ms.vss-test-web.build-test-results-tab&runId=11613622&resultId=100500&paneView=debug
The **Xamarin.Android.Build.Tests - macOS** job has started reporting
some failures within the past couple of days:
System.FormatException : Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException (System.Boolean overflow, System.String overflowResourceKey)
at System.Number.ParseInt32 (System.ReadOnlySpan`1[T] value, System.Globalization.NumberStyles styles, System.Globalization.NumberFormatInfo info)
at System.Int32.Parse (System.ReadOnlySpan`1[T] s, System.Globalization.NumberStyles style, System.IFormatProvider provider)
at System.Version.TryParseComponent (System.ReadOnlySpan`1[T] component, System.String componentName, System.Boolean throwOnFailure, System.Int32& parsedComponent)
at System.Version.ParseVersion (System.ReadOnlySpan`1[T] input, System.Boolean throwOnFailure)
at System.Version.Parse (System.String input)
at System.Version..ctor (System.String version)
at Xamarin.Android.Build.Tests.BaseTest+<>c.<GetPathToLatestBuildTools>b__48_0 (System.String x)
at System.Linq.EnumerableSorter`2[TElement,TKey].ComputeKeys (TElement[] elements, System.Int32 count)
at System.Linq.EnumerableSorter`1[TElement].ComputeMap (TElement[] elements, System.Int32 count)
at System.Linq.EnumerableSorter`1[TElement].Sort (TElement[] elements, System.Int32 count)
at System.Linq.OrderedEnumerable`1[TElement].SortedMap (System.Linq.Buffer`1[TElement] buffer)
at System.Linq.OrderedEnumerable`1+<GetEnumerator>d__3[TElement].MoveNext ()
at Xamarin.Android.Build.Tests.BaseTest.GetPathToLatestBuildTools (System.String exe)
at Xamarin.Android.Build.Tests.BaseTest.GetPathToAapt ()
at Xamarin.Android.Build.Tests.ManagedResourceParserTests.CompareAaptAndManagedParserOutputWithCustomIds ()
What's happened is that somehow, for some reason,
Build-tools 30.0.0-rc1 has been installed onto the build machine:
$HOME/Library/Android/sdk/build-tools/30.0.0-rc1
`30.0.0-rc` cannot be parsed by `System.Version`.
I think we can be a bit more lenient when locating the latest version
of build-tools by instead using a string comparison. This will also
allow the relevant tests to use a preview version of build-tools if
they exist.
Additional logging has also been added to confirm this hypothesis,
which is how we determined that it's Build-tools 30.0.0-rc1.1 parent d1dd186 commit 7aaea22
File tree
1 file changed
+2
-1
lines changed- src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
| 410 | + | |
| 411 | + | |
411 | 412 | | |
412 | 413 | | |
413 | 414 | | |
| |||
0 commit comments