Skip to content

Commit

Permalink
Merge pull request #92 from cat-bro/fix-dry-run-user
Browse files Browse the repository at this point in the history
Fix dry run user
  • Loading branch information
cat-bro authored Apr 21, 2023
2 parents d53e3c2 + d6aea79 commit 537bc67
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions tests/fixtures/mapping-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ users:
scheduling:
require:
- pulsar
[email protected]:
env:
TEST_JOB_SLOTS_USER: "{cores}"
[email protected]:
scheduling:
require:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def test_dry_run_user_email(self):
job_config = os.path.join(os.path.dirname(__file__), 'fixtures/job_conf_dry_run.yml')
tpv_config = os.path.join(os.path.dirname(__file__), 'fixtures/mapping-rules.yml')
output = self.call_shell_command(
"tpv", "dry-run", "--job-conf", job_config, "--input-size", "6", "--user", "fairycake@vortex.org",
"tpv", "dry-run", "--job-conf", job_config, "--input-size", "6", "--user", "krikkitrobot@planetkrikkit.org",
tpv_config)
self.assertTrue("name: TEST_JOB_SLOTS" in output,
f"Expected 'name: TEST_JOB_SLOTS' in destination\n{output}")
self.assertTrue("name: TEST_JOB_SLOTS_USER" in output,
f"Expected 'name: TEST_JOB_SLOTS_USER' in destination\n{output}")
7 changes: 2 additions & 5 deletions tpv/commands/dryrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ def run(self):
@staticmethod
def from_params(job_conf, user=None, tool=None, tpv_confs=None, input_size=None):
if user is not None:
if '@' in user:
username, email = user.split('@', 1)
else:
username, email = (user, 'example.org')
user = mock_galaxy.User(username, email)
email = user
user = mock_galaxy.User('gargravarr', email)
else:
user = None

Expand Down

0 comments on commit 537bc67

Please sign in to comment.