[mozinfo] os_version not set correctly on Arch with linux-ck (custom kernel) installed

UNCONFIRMED
Unassigned

Status

defect
UNCONFIRMED
4 years ago
4 years ago

People

(Reporter: robertthyberg, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

1.08 KB, patch
Details | Diff | Splinter Review
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0
Build ID: 20151015193503

Steps to reproduce:

./mach xpcshell-test toolkit/components/telemetry/tests/unit/test_TelemetrySession.js


Actual results:

./mach xpcshell-test toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
From _tests: Kept 41561 existing; Added/updated 0; Removed 0 files and 0 directories.
Error running mach:

    ['xpcshell-test', 'toolkit/components/telemetry/tests/unit/test_TelemetrySession.js']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

ParseError: could not parse: (toolkit == 'android' || toolkit == 'gonk') || ((os == "win" && os_version == "5.1") ); variables: {'topsrcdir': u'/home/thymaster/mozilla-central', 'pgo': False, 'toolkit': u'gtk3', 'webm': True, 'buildapp': u'browser', 'crashreporter': True, 'addon_signing': True, 'platform_guess': u'linux64', 'appname': u'firefox', 'has_sandbox': True, 'telemetry': False, 'os_version': StringVersion (''), 'version': ' ', 'datareporting': True, 'buildtype_guess': u'opt', 'hasNode': False, 'bits': 64, 'bin_suffix': u'', 'wave': True, 'healthreport': True, 'release_build': False, 'asan': False, 'tests_enabled': True, 'linux_distro': '', 'official': False, 'tsan': False, 'debug': False, 'os': u'linux', 'processor': u'x86_64'}

  File "/home/thymaster/mozilla-central/testing/xpcshell/mach_commands.py", line 373, in run_xpcshell_test
    return xpcshell.run_test(**params)
  File "/home/thymaster/mozilla-central/testing/xpcshell/mach_commands.py", line 72, in run_test
    self.run_suite(**kwargs)
  File "/home/thymaster/mozilla-central/testing/xpcshell/mach_commands.py", line 58, in run_suite
    return self._run_xpcshell_harness(**kwargs)
  File "/home/thymaster/mozilla-central/testing/xpcshell/mach_commands.py", line 137, in _run_xpcshell_harness
    result = xpcshell.runTests(**filtered_args)
  File "/home/thymaster/mozilla-central/testing/xpcshell/runxpcshelltests.py", line 1207, in runTests
    self.buildTestList(test_t./mach xpcshell-test toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
From _tests: Kept 41561 existing; Added/updated 0; Removed 0 files and 0 directories.
Error running mach:

    ['xpcshell-test', 'toolkit/components/telemetry/tests/unit/test_TelemetrySession.js']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

ParseError: could not parse: (toolkit == 'android' || toolkit == 'gonk') || ((os == "win" && os_version == "5.1") ); variables: {'topsrcdir': u'/home/thymaster/mozilla-central', 'pgo': False, 'toolkit': u'gtk3', 'webm': True, 'buildapp': u'browser', 'crashreporter': True, 'addon_signing': True, 'platform_guess': u'linux64', 'appname': u'firefox', 'has_sandbox': True, 'telemetry': False, 'os_version': StringVersion (''), 'version': ' ', 'datareporting': True, 'buildtype_guess': u'opt', 'hasNode': False, 'bits': 64, 'bin_suffix': u'', 'wave': True, 'healthreport': True, 'release_build': False, 'asan': False, 'tests_enabled': True, 'linux_distro': '', 'official': False, 'tsan': False, 'debug': False, 'os': u'linux', 'processor': u'x86_64'}

  File "/home/thymaster/mozilla-central/testing/xpcshell/mach_commands.py", line 373, in run_xpcshell_test
    return xpcshell.run_test(**params)
  File "/home/thymaster/mozilla-central/testing/xpcshell/mach_commands.py", line 72, in run_test
    self.run_suite(**kwargs)
  File "/home/thymaster/mozilla-central/testing/xpcshell/mach_commands.py", line 58, in run_suite
    return self._run_xpcshell_harness(**kwargs)
  File "/home/thymaster/mozilla-central/testing/xpcshell/mach_commands.py", line 137, in _run_xpcshell_harness
    result = xpcshell.runTests(**filtered_args)
  File "/home/thymaster/mozilla-central/testing/xpcshell/runxpcshelltests.py", line 1207, in runTests
    self.buildTestList(test_tags, testPaths)
  File "/home/thymaster/mozilla-central/testing/xpcshell/runxpcshelltests.py", line 820, in buildTestList
    self.alltests = mp.active_tests(filters=filters, **mozinfo.info)
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/manifestparser.py", line 788, in active_tests
    return list(tests)
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/filters.py", line 356, in __call__
    for test in tests:
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/filters.py", line 53, in fail_if
    for test in tests:
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/filters.py", line 41, in run_if
    for test in tests:
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/filters.py", line 30, in skip_if
    if tag in test and parse(test[tag], **values):
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/expression.py", line 281, in parse
    return ExpressionParser(text, values).parse()
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/expression.py", line 267, in parse
    raise ParseError("could not parse: %s; variables: %s" % (self.text, self.valuemapping))
ags, testPaths)
  File "/home/thymaster/mozilla-central/testing/xpcshell/runxpcshelltests.py", line 820, in buildTestList
    self.alltests = mp.active_tests(filters=filters, **mozinfo.info)
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/manifestparser.py", line 788, in active_tests
    return list(tests)
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/filters.py", line 356, in __call__
    for test in tests:
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/filters.py", line 53, in fail_if
    for test in tests:
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/filters.py", line 41, in run_if
    for test in tests:
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/filters.py", line 30, in skip_if
    if tag in test and parse(test[tag], **values):
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/expression.py", line 281, in parse
    return ExpressionParser(text, values).parse()
  File "/home/thymaster/mozilla-central/testing/mozbase/manifestparser/manifestparser/expression.py", line 267, in parse
    raise ParseError("could not parse: %s; variables: %s" % (self.text, self.valuemapping))



Expected results:

tests should of ran
as discussed in IRC, looks like |StringVersion ('')| is the problem.

Can you check the value of |os_version| and |release| just before following line?
https://dxr.mozilla.org/mozilla-central/rev/451a185791433bce1a6a894c27f3da60a3119431/testing/mozbase/mozinfo/mozinfo/mozinfo.py#102
Flags: needinfo?(robertthyberg)
('os_version is', '')
('release is ', '4.1.12-1-ck')
i reccently installed linux-ck. This may have caused the problem.
Flags: needinfo?(robertthyberg)
thanks :)
it's a kernel, right?
maybe changing the line to |if not os_version and ("ARCH" in release or "-ck" in release):| helps?
(not sure if other places are supported or not tho...)
Posted patch bug-1220874 (obsolete) — Splinter Review
Yeahs it a kernel package. I did as you said and I can now run the tests. I uploaded a patch but im not sure if anything else should be done or if anything at all.
Comment on attachment 8682278 [details] [diff] [review]
bug-1220874

Review of attachment 8682278 [details] [diff] [review]:
-----------------------------------------------------------------

::: testing/mozbase/mozinfo/mozinfo/mozinfo.py
@@ +103,1 @@
>          distro = 'arch'

What distro are you running? This will set distro to 'arch'. Is the distro variable set properly before line 102?
Comment on attachment 8682278 [details] [diff] [review]
bug-1220874

Review of attachment 8682278 [details] [diff] [review]:
-----------------------------------------------------------------

Ah nvm, just saw you are running Arch in the bug title.

::: testing/mozbase/mozinfo/mozinfo/mozinfo.py
@@ +98,5 @@
>      # Bug in Python 2's `platform` library:
>      # It will return a triple of empty strings on Arch.
>      # It works on Python 3. If we don't have an OS version,
>      # the unit tests fail to run.
> +    if not os_version and ("ARCH" in release or "-ck" in release):

Please add an explanation of what -ck is to the comment.
Attachment #8682278 - Flags: review+
Summary: mach command ./mach xpcshell-test toolkit/components/telemetry/tests/unit/test_TelemetrySession.js breaks on arch linux → [mozinfo] os_version not set correctly on Arch with linux-ck (custom kernel) installed
Posted patch bug-1220874Splinter Review
Attachment #8682278 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.