Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(variants): correct variant generation: stop generation as soon as…
Browse files Browse the repository at this point in the history
… a command fails
laurent-laporte-pro committed Apr 12, 2024
1 parent d33ebcb commit c8195fc
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -81,6 +81,11 @@ def _generate(
cmd_notifier.index = index
stopwatch.log_elapsed(cmd_notifier)

# stop variant generation as soon as a command fails
if not output.status:
logger.error(f"Command {cmd.command_name} failed: {output.message}")
break

results.success = all(detail["status"] for detail in results.details) # type: ignore

data_type = isinstance(data, FileStudy)
2 changes: 1 addition & 1 deletion tests/integration/test_integration_variantmanager_tool.py
Original file line number Diff line number Diff line change
@@ -49,8 +49,8 @@ def generate_study_with_server(
f"/v1/studies/{base_study_id}/variants?name={urllib.parse.quote_plus(name)}",
headers={"Authorization": f'Bearer {admin_credentials["access_token"]}'},
)
assert res.status_code == 200, res.json()
variant_id = res.json()
assert res.status_code == 200
generator = RemoteVariantGenerator(variant_id, session=client, token=admin_credentials["access_token"])
return generator.apply_commands(commands, matrices_dir), variant_id

0 comments on commit c8195fc

Please sign in to comment.