4. Run `cosmic-ray init tutorial.toml tutorial.sqlite`
5. Run `cr-filter-operators tutorial.sqlite tutorial.toml`
6. Run `cosmic-ray exec tutorial.toml tutorial.sqlite`
7. Run `cosmic-ray dump tutorial.sqlite`
8. Observe error
cosmic_ray/cli.py", line 192, in result_to_dict
d["test_outcome"] = d["test_outcome"].value
AttributeError: 'NoneType' object has no attribute 'value'
The problem comes about because the filtered jobs are skipped, so have no `test_outcome`. This could probably be fixed with a simple `if` statement in the line above to test whether `d["test_outcome"] is not None` before trying to access the value, although that might then pass the problem further down the line.
A fix is not a particularly high priority for me, but I thought I'd report the issue, and would be happy to attempt a pull request if that's something you're interested in.
Summary
Dumping a database with filtered operators gives
AttributeError: 'NoneType' object has no attribute 'value'
because skipped jobs have no test outcome.Steps to reproduce
ROOT/mod.py
with contentROOT/test_mod.py
with contentclass Tests(unittest.TestCase): def test_func(self): self.assertEqual(mod.func(), 1234)
[cosmic-ray] module-path = "mod.py" timeout = 10.0 excluded-modules = [] test-command = "python -m unittest test_mod.py"
[cosmic-ray.distributor] name = "local"
[cosmic-ray.filters.operators-filter] exclude-operators = [ "core/NumberReplacer" ]
cosmic_ray/cli.py", line 192, in result_to_dict d["test_outcome"] = d["test_outcome"].value AttributeError: 'NoneType' object has no attribute 'value'