Code Monkey home page Code Monkey logo

Comments (7)

masayukig avatar masayukig commented on June 26, 2024

I think it causes because the file has idempotent ids, and it's like regexes.

tempest.api.volume.test_volumes_list.VolumesListTestJSON.test_volumes_list_by_bootable[id-2016a942-3020-40d7-95ce-7613bf8407ce]

And ostestr just ignores the --whitelist-file option in the list mode.

So, you would face the same error if you run ostestr without -l option like below.

$ ostestr  --whitelist-file ./2018.02-test-list.txt
Traceback (most recent call last):
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/bin/ostestr", line 11, in <module>
    sys.exit(main())
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib/python3.6/site-packages/os_testr/ostestr.py", line 273, in main
    exit(ostestr(sys.argv[1:]))
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib/python3.6/site-packages/os_testr/ostestr.py", line 269, in ostestr
    return _select_and_call_runner(opts, regex, others)
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib/python3.6/site-packages/os_testr/ostestr.py", line 222, in _select_and_call_runner
    black_regex=opts.black_regex)
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib/python3.6/site-packages/os_testr/ostestr.py", line 177, in call_testr
    black_regex=black_regex)
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib/python3.6/site-packages/stestr/commands/run.py", line 416, in run_command
    suppress_attachments=suppress_attachments)
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib/python3.6/site-packages/stestr/commands/run.py", line 463, in _run_tests
    cmd.setUp()
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib/python3.6/site-packages/stestr/test_processor.py", line 148, in setUp
    black_regex=self.black_regex)
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib/python3.6/site-packages/stestr/selection.py", line 113, in construct_list
    list_of_test_cases = filter_tests(regexes, test_ids)
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib/python3.6/site-packages/stestr/selection.py", line 29, in filter_tests
    _filters = list(map(re.compile, filters))
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib64/python3.6/re.py", line 233, in compile
    return _compile(pattern, flags)
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib64/python3.6/re.py", line 301, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib64/python3.6/sre_compile.py", line 562, in compile
    p = sre_parse.parse(p, flags)
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib64/python3.6/sre_parse.py", line 855, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib64/python3.6/sre_parse.py", line 416, in _parse_sub
    not nested and not items))
  File "/home/masayuki/git/openstack/os-testr/.tox/py36/lib64/python3.6/sre_parse.py", line 553, in _parse
    raise source.error(msg, len(this) + 1 + len(that))
sre_constants.error: bad character range 5-4 at position 92

from stestr.

chkumar246 avatar chkumar246 commented on June 26, 2024

@masayukig Thanks for the input, yup the same error is coming on ostestr also. Is it possible to add idempotent ids support in stestr also?

from stestr.

masayukig avatar masayukig commented on June 26, 2024

I think it might be good if stestr run accepts stestr list output with idempotent ids like Tempest test list. But I think it might be a bit tricky change and a hard to keep consistency to distinguish regexes or idempotent ids.

@mtreinish Any thoughts?

from stestr.

masayukig avatar masayukig commented on June 26, 2024

@chkumar246 actually, there can be not only idempotent ids but also decorators such as slow, negative, compute, volume, etc...

So, it might be possible with applying a filter which is using [0] after splitting with [ character.
But I think we need to introduce a new option for that like --whitelist-file-noregex.. (I'm not a fan of like this option addition, though..)

from stestr.

masayukig avatar masayukig commented on June 26, 2024

Ah, I think stestr run --load-list is the option for that. But it's only in run not in list. So, one idea is enabling that bringing the option to list too.

Another idea is introducing --dry-run option to stestr run. But I feel that would be conflicted with stestr list command, though.

from stestr.

mtreinish avatar mtreinish commented on June 26, 2024

Right, this is not a bug. The docs for --whiteliest-file clearly say (in multiple places) that each line is treated as a separate regex. Passing an invalid regex in (which is what you're doing with that file from refstack) is things failing because of bad input. We maybe could have a better error message which doesn't result in a strack trace, but tha's a separate thing. This has nothing to do with idempotent ids or any other attributes. The '[' ']' surrounding the args are really just an artifact of displaying the attributes set on a test. You can already easily just filter on them using a valid regex.

What you have there is list for the --load-list argument on stestr run. Since you're specifying exactly what tests to run. IIRC the refstack/interop guideline docs actually explicitly say use --load-list.

@masayukig there isn't really a need for --load-list as an option on stestr list because there is nothing to list with --load-list, it would be the same as running cat load_list.txt. --load-list takes the place of discovery and any test selection and explicitly tells stestr run what the tests it needs to schedule and execute are.

from stestr.

masayukig avatar masayukig commented on June 26, 2024

@mtreinish yeah, I noticed that. So, I was thinking --dry-run might be one option. But I feel it's a bit overkill/too much. So, I think your #182 change is enough.

from stestr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.