From 151656a561acd541305918e539f81a2f5a735458 Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Tue, 5 Mar 2019 09:45:08 -0800 Subject: [PATCH] Windows, test wrapper: fix broken integration test Fixes https://github.com/bazelbuild/bazel/issues/7632 Closes #7633. PiperOrigin-RevId: 236865291 --- src/test/py/bazel/test_wrapper_test.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/test/py/bazel/test_wrapper_test.py b/src/test/py/bazel/test_wrapper_test.py index 7514fd34c5a941..ba91bd6e41f0ea 100644 --- a/src/test/py/bazel/test_wrapper_test.py +++ b/src/test/py/bazel/test_wrapper_test.py @@ -443,10 +443,21 @@ def _AssertUndeclaredOutputs(self, flag): # machines run Windows Server 2016 core which recognizes fewer MIME types # than desktop Windows versions, and one of the recognized types is ".ico" # files. - self.assertListEqual(mf_content, [ - 'out1/data1.ico\t70\timage/x-icon', - 'out2/data2.dat\t16\tapplication/octet-stream' - ]) + # Update(2019-03-05): apparently this MIME type is now recognized on CI as + # as "image/vnd.microsoft.icon". The standard MIME type is "image/x-icon", + # but Wikipedia lists a few alterantive ones, so the test will accept all of + # them. + if len(mf_content) != 2: + self._FailWithOutput(mf_content) + tokens = mf_content[0].split('\t') + if (len(tokens) != 3 or tokens[0] != 'out1/data1.ico' or + tokens[1] != '70' or tokens[2] not in [ + 'image/x-icon', 'image/vnd.microsoft.icon', 'image/ico', + 'image/icon', 'text/ico', 'application/ico' + ]): + self._FailWithOutput(mf_content) + if mf_content[1] != 'out2/data2.dat\t16\tapplication/octet-stream': + self._FailWithOutput(mf_content) def _AssertUndeclaredOutputsAnnotations(self, flag): exit_code, bazel_testlogs, stderr = self.RunBazel(