Skip to content

Commit

Permalink
no need for a prompt if it profile is set as a parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Feb 19, 2024
1 parent 75f6f19 commit f4a4c2f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nf_core/components/components_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def check_inputs(self) -> None:
)

# Check container software to use
if os.environ.get("PROFILE") is None:
if os.environ.get("PROFILE") is None and self.profile is None:
os.environ["PROFILE"] = ""
if self.no_prompts:
log.info(
Expand Down Expand Up @@ -237,16 +237,18 @@ def check_snapshot_stability(self) -> bool:
log.error("nf-test snapshot is not stable")
self.errors.append("nf-test snapshot is not stable")
return False

else:
if self.obsolete_snapshots:
# ask if the user wants to remove obsolete snapshots using nf-test --clean-snapshot
if self.no_prompts or Confirm.ask(
"nf-test found obsolete snapshots. Do you want to remove them?", default=True
):
profile = self.profile if self.profile else os.environ["PROFILE"]
log.info("Removing obsolete snapshots")
nf_core.utils.run_cmd(
"nf-test",
f"test --tag {self.component_name} --profile {os.environ['PROFILE']} --clean-snapshot",
f"test --tag {self.component_name} --profile {profile} --clean-snapshot",
)
else:
log.debug("Obsolete snapshots not removed")
Expand Down

0 comments on commit f4a4c2f

Please sign in to comment.