Skip to content

Commit d6bb4ce

Browse files
committed
[1.10>1.11] [MERGE #5758 @sethbrenith] Use different machine pool for OSX CI builds
Merge pull request #5758 from sethbrenith:user/sethb/osx-ci This is the combination of several changes that have already gone into release/1.10-ci. It updates our CI configuration to build on a different set of Macs, and fixes unit tests that fail with the version of ICU installed on those machines.
2 parents cd45bae + 4d71463 commit d6bb4ce

File tree

5 files changed

+71
-37
lines changed

5 files changed

+71
-37
lines changed

netci.groovy

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def machineTypeToOSTagMap = [
2222
'Windows_NT': 'Windows 8.1', // 'latest-or-auto' -> Windows Server 2012 R2 ~= Windows 8.1 aka Blue
2323
'windows.10.amd64.clientrs4.devex.open': 'Windows 10', // = Windows 10 RS4 with Dev 15.7
2424
'Ubuntu16.04': 'Ubuntu',
25-
'OSX10.12': 'OSX'
25+
'OSX.1011.Amd64.Chakra.Open': 'OSX'
2626
]
2727

2828
def defaultMachineTag = 'latest-or-auto'
@@ -141,11 +141,12 @@ def CreateXPlatBuildTask = { isPR, buildType, staticBuild, machine, platform, co
141141
def buildFlag = buildType == "release" ? "" : (buildType == "debug" ? "--debug" : "--test-build")
142142
def staticFlag = staticBuild ? "--static" : ""
143143
def swbCheckFlag = (platform == "linux" && buildType == "debug" && !staticBuild) ? "--wb-check" : "";
144-
def icuFlag = (platform == "osx" ? "--icu=/usr/local/opt/icu4c/include" : "")
144+
def icuFlag = (platform == "osx" ? "--icu=/Users/DDITLABS/homebrew/opt/icu4c/include" : "")
145145
def compilerPaths = (platform == "osx") ? "" : "--cxx=/usr/bin/clang++-3.9 --cc=/usr/bin/clang-3.9"
146146
def buildScript = "bash ./build.sh ${staticFlag} -j=`${numConcurrentCommand}` ${buildFlag} " +
147147
"${swbCheckFlag} ${compilerPaths} ${icuFlag} ${customOption} ${extraBuildParams}"
148-
def testScript = "bash test/runtests.sh \"${testVariant}\""
148+
def icuLibFlag = (platform == "osx" ? "--iculib=/Users/DDITLABS/homebrew/opt/icu4c" : "")
149+
def testScript = "bash test/runtests.sh ${icuLibFlag} \"${testVariant}\""
149150

150151
def newJob = job(jobName) {
151152
steps {
@@ -161,7 +162,11 @@ def CreateXPlatBuildTask = { isPR, buildType, staticBuild, machine, platform, co
161162
true, // doNotFailIfNothingArchived=false ~= failIfNothingArchived (true ~= doNotFail)
162163
false) // archiveOnlyIfSuccessful=false ~= archiveAlways
163164

164-
Utilities.setMachineAffinity(newJob, machine, defaultMachineTag)
165+
if (platform == "osx") {
166+
Utilities.setMachineAffinity(newJob, machine) // OSX machine string contains all info already
167+
} else {
168+
Utilities.setMachineAffinity(newJob, machine, defaultMachineTag)
169+
}
165170
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
166171

167172
if (nonDefaultTaskSetup == null) {
@@ -389,7 +394,7 @@ if (isXPlatCompatibleBranch) {
389394
// ---------------
390395

391396
if (isXPlatCompatibleBranch) {
392-
def osString = 'OSX10.12'
397+
def osString = 'OSX.1011.Amd64.Chakra.Open'
393398

394399
// PR and CI checks
395400
CreateXPlatBuildTasks(osString, "osx", "osx", branch, null, "")

test/Intl/NumberFormat.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
77

8+
let suppressFormatEqualityCheck = false;
9+
810
function format() {
911
let locale = "en-US", options, n;
1012
assert.isTrue(arguments.length > 0);
@@ -22,7 +24,7 @@ function format() {
2224
const localeString = n.toLocaleString(locale, options);
2325

2426
assert.isTrue(format === localeString, `[locale = ${JSON.stringify(locale)}, options = ${JSON.stringify(options)}] format does not match toLocaleString`);
25-
if (WScript.Platform.INTL_LIBRARY === "icu") {
27+
if (WScript.Platform.INTL_LIBRARY === "icu" && !suppressFormatEqualityCheck) {
2628
assert.isTrue(format === nf.formatToParts(n).map((part) => part.value).join(""), `[locale = ${JSON.stringify(locale)}, options = ${JSON.stringify(options)}] format does not match formatToParts`);
2729
}
2830

@@ -141,7 +143,12 @@ const tests = [
141143
assert.areEqual("$1.50", formatCurrency({ currencyDisplay: "symbol" }, 1.504), "Currency display: symbol");
142144
assert.areEqual("$1.51", formatCurrency({ currencyDisplay: "symbol" }, 1.505), "Currency display: symbol");
143145
// ICU has a proper "name" currency display, while WinGlob falls back to "code"
146+
if (WScript.Platform.ICU_VERSION === 62) {
147+
// In ICU 62, there is a mismatch between "1.00 US dollar" and "1.00 US dollars"
148+
suppressFormatEqualityCheck = true;
149+
}
144150
assert.matches(/(?:USD[\x20\u00a0]?1.00|1.00 US dollars)/, formatCurrency({ currencyDisplay: "name" }, 1), "Currency display: name");
151+
suppressFormatEqualityCheck = false;
145152
assert.matches(/(?:USD[\x20\u00a0]?1.50|1.50 US dollars)/, formatCurrency({ currencyDisplay: "name" }, 1.504), "Currency display: name");
146153
assert.matches(/(?:USD[\x20\u00a0]?1.51|1.51 US dollars)/, formatCurrency({ currencyDisplay: "name" }, 1.505), "Currency display: name");
147154
}
@@ -217,7 +224,9 @@ const tests = [
217224
{ type: "group", value: "," },
218225
{ type: "integer", value: "000" }
219226
]);
220-
assertParts("en-US", undefined, NaN, [{ type: "nan", value: "NaN" }]);
227+
if (WScript.Platform.ICU_VERSION !== 62) {
228+
assertParts("en-US", undefined, NaN, [{ type: "nan", value: "NaN" }]);
229+
}
221230
assertParts("en-US", undefined, Infinity, [{ type: "infinity", value: "∞" }]);
222231
assertParts("en-US", undefined, 1000.3423, [
223232
{ type: "integer", value: "1" },

test/Strings/unicode_toUpperCase_toLowerCase.js

Lines changed: 32 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/runtests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,11 @@ def _should_test(self, test):
398398

399399
# print output from multi-process run, to be sent with result message
400400
def _print(self, line):
401-
self._print_lines.append(str(line))
401+
self._print_lines.append(line)
402402

403403
# queue a test result from multi-process runs
404404
def _log_result(self, test, fail):
405-
output = '\n'.join(self._print_lines) # collect buffered _print output
405+
output = u'\n'.join(self._print_lines).encode('utf-8') # collect buffered _print output
406406
self._print_lines = []
407407
self.msg_queue.put((test.filename, fail, test.elapsed_time, output))
408408

test/runtests.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,22 @@ popd > /dev/null
1414
build_type=
1515
binary_path=
1616
release_build=0
17-
test_variant=$1
17+
18+
while [[ $# -gt 0 ]]; do
19+
case "$1" in
20+
--iculib=*)
21+
ICU4C_LIBRARY_PATH=$1
22+
ICU4C_LIBRARY_PATH="${ICU4C_LIBRARY_PATH:9}"
23+
export ICU4C_LIBRARY_PATH
24+
;;
25+
26+
*)
27+
test_variant=$1
28+
;;
29+
esac
30+
31+
shift
32+
done
1833

1934
if [[ -f "$test_path/../out/Debug/ch" ]]; then
2035
echo "Warning: Debug build was found"

0 commit comments

Comments
 (0)