Skip to content

Commit

Permalink
[Jenkins] remove some duplicate test phases (#3534)
Browse files Browse the repository at this point in the history
As we slowly migrate to Azure DevOps, there are some duplicate phases
we are running on Jenkins that mostly produce noise, such as:

  * MSBuild Tests - we commonly get failures related to NuGet
  * BCL Tests - enough said...
  * Networking-related issues on APK-based tests

For now we could replace the call:

    make run-all-tests

To run a subset:

    make run-performance-tests

This will keep the existing plots we have working. OSS contributors
will still have access to builds, etc.

Other changes:

  * The `run-performance-tests` target should run the APK-based
    performance tests.
  * We need to add `Mono.Android-Tests` to the APK performance tests.
  • Loading branch information
jonathanpeppers authored and jonpryor committed Aug 24, 2019
1 parent d1f6bd2 commit ed597fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,15 @@ endif

run-apk-tests:
_r=0 ; \
$(call MSBUILD_BINLOG,run-apk-tests,,Test) $(TEST_TARGETS) /t:RunApkTests /p:RunApkTestsTarget=RunPerformanceApkTests $(APK_TESTS_PROP) || _r=$$? ; \
$(call MSBUILD_BINLOG,run-apk-tests,,Test) $(TEST_TARGETS) /t:RunApkTests $(APK_TESTS_PROP) || _r = $$? ; \
$(call MSBUILD_BINLOG,run-apk-tests,,Test) $(TEST_TARGETS) /t:RunApkTests /p:RunApkTestsTarget=RunPerformanceApkTests $(APK_TESTS_PROP) || _r=1 ; \
$(call MSBUILD_BINLOG,run-apk-tests,,Test) $(TEST_TARGETS) /t:RunApkTests $(APK_TESTS_PROP) || _r=1 ; \
exit $$_r

run-performance-tests:
$(call MSBUILD_BINLOG,run-performance-tests,,Test) $(TEST_TARGETS) /t:RunPerformanceTests
_r=0 ; \
$(call MSBUILD_BINLOG,run-apk-tests,,Test) $(TEST_TARGETS) /t:RunApkTests /p:RunApkTestsTarget=RunPerformanceApkTests $(APK_TESTS_PROP) || _r=1 ; \
$(call MSBUILD_BINLOG,run-performance-tests,,Test) $(TEST_TARGETS) /t:RunPerformanceTests || _r=1 ; \
exit $$_r

list-nunit-tests:
$(MSBUILD) $(MSBUILD_FLAGS) $(TEST_TARGETS) /t:ListNUnitTests
Expand Down
18 changes: 5 additions & 13 deletions build-tools/automation/build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -291,25 +291,17 @@ timestamps {
}
}

utils.stageWithTimeout('run all tests', 360, 'MINUTES', XADir, false) { // Typically takes 6hr
utils.stageWithTimeout('run performance tests', 60, 'MINUTES', XADir, false) {
if (skipTest) {
echo "Skipping 'run all tests' stage. Clear the SkipTest variable setting to build and run tests"
echo "Skipping 'run performance tests' stage. Clear the SkipTest variable setting to build and run tests"
return
}

echo "running tests"
echo "running performance tests"

def skipNunitTests = false

if (isPr) {
def hasPrLabelRunTestsRelease = utils.hasPrLabel(gitRepo, env.ghprbPullId, 'run-tests-release')
skipNunitTests = hasPrLabelFullMonoIntegrationBuild || hasPrLabelRunTestsRelease
echo "Run all tests: Labels on the PR: 'full-mono-integration-build' (${hasPrLabelFullMonoIntegrationBuild}) and/or 'run-tests-release' (${hasPrLabelRunTestsRelease})"
}

commandStatus = sh (script: "make run-all-tests CONFIGURATION=${env.BuildFlavor} V=1" + (skipNunitTests ? " SKIP_NUNIT_TESTS=1" : ""), returnStatus: true)
commandStatus = sh (script: "make run-performance-tests CONFIGURATION=${env.BuildFlavor} V=1", returnStatus: true)
if (commandStatus != 0) {
error "run-all-tests FAILED, status: ${commandStatus}" // Ensure stage is labeled as 'failed' and red failure indicator is displayed in Jenkins pipeline steps view
error "run-performance-tests FAILED, status: ${commandStatus}" // Ensure stage is labeled as 'failed' and red failure indicator is displayed in Jenkins pipeline steps view
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/RunApkTests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</Target>

<ItemGroup>
<_ApkPerfTests Include="Xamarin.Android.Locale_Tests;Xamarin.Forms_Performance_Integration">
<_ApkPerfTests Include="Mono.Android_Tests;Xamarin.Android.Locale_Tests;Xamarin.Forms_Performance_Integration">
<Package>%(Identity)</Package>
</_ApkPerfTests>
</ItemGroup>
Expand Down

0 comments on commit ed597fb

Please sign in to comment.