Project

General

Profile

Actions

Bug #13308

closed

testrunner/run needs updates for python 3.9

Added by Andy Fiddaman 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tests
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Python 3.9 is more picky about the incorrect usage of is with a literal:

bloody:illumos:upstream_gate% python3.9 usr/src/test/test-runner/cmd/run
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:109: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif self.returncode is 0:
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:112: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif self.returncode is 3 or self.returncode is 4:
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:112: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif self.returncode is 3 or self.returncode is 4:
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:115: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  elif self.returncode is not 0:
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:308: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  elif self.result.result is not 'PASS':
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:404: SyntaxWarning: "is" with a literal. Did you mean "=="?
  cont = pretest.result.result is 'PASS'
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:479: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  return len(self.tests) is not 0
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:497: SyntaxWarning: "is" with a literal. Did you mean "=="?
  cont = pretest.result.result is 'PASS'
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:715: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if options.cmd is not 'wrconfig':
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:753: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if Result.total is 0:
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:758: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if Result.runresults[key] is not 0:
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:800: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if p.returncode is not 0:
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:836: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if option.dest is 'runfile' and '-w' in parser.rargs or \
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:837: SyntaxWarning: "is" with a literal. Did you mean "=="?
  option.dest is 'template' and '-c' in parser.rargs:
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:843: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if option.dest is 'runfile':
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:845: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if option.dest is 'template':
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:905: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if options.cmd is 'runtests':
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:907: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif options.cmd is 'rdconfig':
/data/omnios-build/omniosorg/bloody/illumos/usr/src/test/test-runner/cmd/run:909: SyntaxWarning: "is" with a literal. Did you mean "=="?
  elif options.cmd is 'wrconfig':
Actions #1

Updated by Electric Monk 6 months ago

  • Gerrit CR set to 1058
Actions #2

Updated by Andy Fiddaman 6 months ago

I tested the proposed change (see Gerrit review link) by using the testrunner/run command to run the libc tests with python versions 2.7, 3.7 and 3.9

I also did a full gate build with this patch applied, specifying python 3.9 in the .env file and using host system pkg(5) tools that are running with python 3.9 (which is what showed up the error originally)

Actions #3

Updated by Electric Monk 6 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 1a2acdcd3ce765904dbf2bfc511e92d68022d100

commit  1a2acdcd3ce765904dbf2bfc511e92d68022d100
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2020-11-13T16:25:40.000Z

    13308 testrunner/run needs updates for python 3.9
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Sebastian Wiedenroth <sebastian.wiedenroth@skylime.net>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Actions

Also available in: Atom PDF