Skip to content

Commit

Permalink
Set the --user argument as user email
Browse files Browse the repository at this point in the history
  • Loading branch information
cat-bro committed Apr 20, 2023
1 parent 1fcdb78 commit b38b05c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 5 additions & 0 deletions tests/fixtures/mapping-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ users:
scheduling:
require:
- pulsar
[email protected]:
env:
TEST_JOB_SLOTS_USER: "{cores}"
params:
native_spec_user: "--mem {mem} --cores {cores}"
[email protected]:
scheduling:
require:
Expand Down
2 changes: 1 addition & 1 deletion 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_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 b38b05c

Please sign in to comment.