Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rez-test breaks with packages that do not have a timestamp attribute #1237

Closed
brentVilla opened this issue Feb 28, 2022 · 4 comments · Fixed by #1238
Closed

rez-test breaks with packages that do not have a timestamp attribute #1237

brentVilla opened this issue Feb 28, 2022 · 4 comments · Fixed by #1238
Assignees

Comments

@brentVilla
Copy link

I ran rez-test with rez-2.103.4 and I got this error:

Traceback (most recent call last):
  File "/rel/third_party/rez///2.103.4/bin/rez/rez-test", line 8, in <module>
    sys.exit(run_rez_test())
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/_entry_points.py", line 257, in run_rez_test
    return run("test")
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/_main.py", line 202, in run
    returncode = run_cmd()
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/_main.py", line 194, in run_cmd
    return func(opts, opts.parser, extra_arg_groups)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/cli/test.py", line 121, in command
    ret = runner.run_test(test_name)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_test.py", line 283, in run_test
    target_variants = self._get_target_variants(test_name)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_test.py", line 641, in _get_target_variants
    context = self._get_context(requires, quiet=True)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_test.py", line 607, in _get_context
    **self.context_kwargs
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/resolved_context.py", line 325, in __init__
    resolver.solve()
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/utils/memcached.py", line 282, in wrapper
    return func(*nargs, **kwargs)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/resolver.py", line 134, in solve
    solver = self._solve()
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/resolver.py", line 418, in _solve
    print_stats=self.print_stats)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 2006, in __init__
    phase = _ResolvePhase(solver=self)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 1254, in __init__
    scope = _PackageScope(package_request, solver=solver)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 987, in __init__
    package_request.name, package_request.range)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 2369, in _get_variant_slice
    package_name=package_name, range_=range_)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 959, in get_variant_slice
    entries = variant_list.get_intersection(range_)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/solver.py", line 522, in get_intersection
    rule = self.solver.package_filter.excludes(package)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 266, in excludes
    rule = f.excludes(package)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 125, in excludes
    excl = _match(excludes)
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 117, in _match
    if rule.match(package):
  File "/rel/third_party/rez/2.103.4/lib/python3.7/site-packages/rez/package_filter.py", line 528, in match
    return (package.timestamp > self.timestamp)
TypeError: '>' not supported between instances of 'NoneType' and 'int'

You will see this error if any of the packages in your rez-test environment do not have a timestamp attribute in their package.py. You can reproduce the error with a package.py like this:

name = 'b'
version = '1.0.0'

tests = {
    'echo': {
        'command' : 'echo hello world',
    }
}

rez-test b should fail. Add a timestamp attribute into the package.py and it will pass. I don't know what version of rez this started breaking, but it was working in 2.88.2 which is our current version before trying to make the leap to 2.103.4.

@nerdvegas
Copy link
Contributor

nerdvegas commented Feb 28, 2022 via email

@nerdvegas
Copy link
Contributor

nerdvegas commented Mar 1, 2022 via email

@ColinKennedy
Copy link

ColinKennedy commented Mar 1, 2022

@nerdvegas I get the same error when I added fake packages while working with rez-selftest. I hadn't applied any explicit package_filters. Though I didn't check around to see if other unittests might have been.

I added fake timestamps to make the error go away :). If you need a repro, let me know and I can make one.

@nerdvegas
Copy link
Contributor

so this appears to be a python 3 issue. The bug is there in py2 but doesn't present as a bug since None/int comparison is valid in py2.

Fix incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants