Cyberbrain icon indicating copy to clipboard operation
Cyberbrain copied to clipboard

Should only create gold data files if cyberbrain ran successfully

Open laike9m opened this issue 3 years ago • 3 comments

Currently, even if cyberbrain fails, new json files will be created.

Relevant code: https://github.com/laike9m/Cyberbrain/blob/master/test/conftest.py#L128-L141

laike9m avatar Jan 05 '22 06:01 laike9m

How do we know whether cyberbrain ran successfully? if tracer_events==golden_filepath returns True indicates it ran successfully?

2000prath avatar May 23 '22 05:05 2000prath

@victorjzsun is supposed to improve this, and can provide more context

laike9m avatar May 30 '22 20:05 laike9m

yield will return whether the test ran successfully or unsuccessfully, we then immediately create/compare golden files with tracer_events.You'd need to find a way to check if it ran successfully, for example, using a hook or doing something like pytest-golden plugin and use a separate command for updating. I haven't done too much investigation regarding this but it might be hard to ensure every test passes before writing all of the golden files

victorjzsun avatar May 31 '22 18:05 victorjzsun