From d2cd342d9021d5df93883ce7571290832c74821b Mon Sep 17 00:00:00 2001 From: Matt Ellis Date: Thu, 12 Jan 2017 17:37:15 -0800 Subject: [PATCH] Use a fixed version of CoreFX for testing CoreFX is going to be merging changes soon that will break how we consume them to do our testing. To give us time to react, we'll fix the version of the repository we build to a commit before the changes. We'll also download artifacts from a saved build (produced before the change took place) so the layout is as we expect. The issue tracking cleaning this up is dotnet/coreclr#8937 Commit migrated from https://github.com/dotnet/coreclr/commit/396c9577f1a947224d73d12d95c45c5b2c624306 --- src/coreclr/netci.groovy | 9 +++++++-- src/coreclr/tests/scripts/run-corefx-tests.py | 28 +++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/coreclr/netci.groovy b/src/coreclr/netci.groovy index 94104b5..d15f2e9 100755 --- a/src/coreclr/netci.groovy +++ b/src/coreclr/netci.groovy @@ -1902,6 +1902,7 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR if (enableCorefxTesting) { def workspaceRelativeFxRoot = "_/fx" def absoluteFxRoot = "%WORKSPACE%\\_\\fx" + buildCommands += "python %WORKSPACE%\\tests\\scripts\\run-corefx-tests.py -arch ${arch} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${stepScriptLocation}" setTestJobTimeOut(newJob, scenario) @@ -2067,6 +2068,7 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR // Build and text corefx def workspaceRelativeFxRoot = "_/fx" def absoluteFxRoot = "\$WORKSPACE/${workspaceRelativeFxRoot}" + buildCommands += "python \$WORKSPACE/tests/scripts/run-corefx-tests.py -arch ${arch} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${scriptFileName}" setTestJobTimeOut(newJob, scenario) @@ -2450,7 +2452,7 @@ combinedScenarios.each { scenario -> copyArtifacts("${corefxFolder}/linuxarmemulator_softfp_cross_${lowerConfiguration}") { includePatterns('bin/build.tar.gz') buildSelector { - latestSuccessful(true) + latestSaved() } } } @@ -2770,6 +2772,9 @@ combinedScenarios.each { scenario -> // Get corefx shell("git clone https://github.com/dotnet/corefx fx") + // CoreFX is changing their output format and scripts, pick a stable version until all that work has landed. + shell("git -C ./fx checkout 551fe49174378adcbf785c0ab12fc69355cef6e8") + // Build Linux corefx shell("./fx/build-native.sh -release -buildArch=x64 -os=Linux") shell("./fx/build-managed.sh -release -buildArch=x64 -osgroup=Linux -skiptests") @@ -2835,7 +2840,7 @@ combinedScenarios.each { scenario -> copyArtifacts("${corefxFolder}/${osJobName}_release") { includePatterns('bin/build.tar.gz') buildSelector { - latestSuccessful(true) + latestSaved() } } diff --git a/src/coreclr/tests/scripts/run-corefx-tests.py b/src/coreclr/tests/scripts/run-corefx-tests.py index 84ab3b7..b65fa5e 100644 --- a/src/coreclr/tests/scripts/run-corefx-tests.py +++ b/src/coreclr/tests/scripts/run-corefx-tests.py @@ -63,6 +63,7 @@ parser.add_argument('-build_type', dest='build_type', default='Debug') parser.add_argument('-clr_root', dest='clr_root', default=None) parser.add_argument('-fx_root', dest='fx_root', default=None) parser.add_argument('-fx_branch', dest='fx_branch', default='master') +parser.add_argument('-fx_commit', dest='fx_commit', default=None) parser.add_argument('-env_script', dest='env_script', default=None) @@ -75,8 +76,8 @@ def validate_args(args): Args: args (argparser.ArgumentParser): Args parsed by the argument parser. Returns: - (arch, build_type, clr_root, fx_root, fx_branch, env_script) - (str, str, str, str, str, str) + (arch, build_type, clr_root, fx_root, fx_branch, fx_commit, env_script) + (str, str, str, str, str, str, str) Notes: If the arguments are valid then return them all in a tuple. If not, raise an exception stating x argument is incorrect. @@ -87,6 +88,7 @@ def validate_args(args): clr_root = args.clr_root fx_root = args.fx_root fx_branch = args.fx_branch + fx_commit = args.fx_commit env_script = args.env_script def validate_arg(arg, check): @@ -115,6 +117,9 @@ def validate_args(args): validate_arg(build_type, lambda item: item in valid_build_types) validate_arg(fx_branch, lambda item: True) + if fx_commit is None: + fx_commit = '551fe49174378adcbf785c0ab12fc69355cef6e8' if fx_branch == 'master' else 'HEAD' + if clr_root is None: clr_root = nth_dirname(os.path.abspath(sys.argv[0]), 3) else: @@ -130,7 +135,7 @@ def validate_args(args): validate_arg(env_script, lambda item: os.path.isfile(env_script)) env_script = os.path.abspath(env_script) - args = (arch, build_type, clr_root, fx_root, fx_branch, env_script) + args = (arch, build_type, clr_root, fx_root, fx_branch, fx_commit, env_script) log('Configuration:') log(' arch: %s' % arch) @@ -138,6 +143,7 @@ def validate_args(args): log(' clr_root: %s' % clr_root) log(' fx_root: %s' % fx_root) log(' fx_branch: %s' % fx_branch) + log(' fx_commit: %s' % fx_commit) log(' env_script: %s' % env_script) return args @@ -191,7 +197,7 @@ def main(args): global Corefx_url global Unix_name_map - arch, build_type, clr_root, fx_root, fx_branch, env_script = validate_args( + arch, build_type, clr_root, fx_root, fx_branch, fx_commit, env_script = validate_args( args) clr_os = 'Windows_NT' if Is_windows else Unix_name_map[os.uname()[0]] @@ -234,6 +240,20 @@ def main(args): if returncode != 0: sys.exit(returncode) + + command = "git -C %s checkout %s" % ( + fx_root, fx_commit) + + log(command) + + if testing: + returncode = 0 + else: + returncode = os.system(command) + + if returncode != 0: + sys.exit(returncode) + cwd = os.getcwd() log('cd ' + fx_root) os.chdir(fx_root) -- 2.7.4