Skip to content

Commit

Permalink
start to extend tests
Browse files Browse the repository at this point in the history
for container env variable setting
  • Loading branch information
bernt-matthias authored and mvdbeek committed Jul 31, 2024
1 parent 51e7291 commit 0cac78a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/functional/tools/job_environment_default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ echo "\$HOME" > '$home' &&
echo "\$TMP" > '$tmp' &&
echo "\$SOME_ENV_VAR" > '$some_env_var' &&
echo "\$JOBCONF_ENV_VAR" > '$jobconf_env_var' &&
echo "\$CONTAINER_ENV_VAR" > '$container_env_var' &&
touch "\$_GALAXY_JOB_TMP_DIR/tmp_test" &&
touch "\$HOME/home_test" &&
Expand All @@ -30,6 +31,7 @@ touch "\${TMPDIR:-/tmp}/job_tmpdir"
<data name="tmp" format="txt" label="tmp" />
<data name="some_env_var" format="txt" label="env_var" />
<data name="jobconf_env_var" format="txt" label="jobconf_env_var" />
<data name="container_env_var" format="txt" label="container_env_var" />
</outputs>
<tests>
</tests>
Expand Down
2 changes: 2 additions & 0 deletions test/functional/tools/job_environment_default_legacy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ echo "\$HOME" > '$home' &&
echo "\$TMP" > '$tmp' &&
echo "\$SOME_ENV_VAR" > '$some_env_var' &&
echo "\$JOBCONF_ENV_VAR" > '$jobconf_env_var' &&
echo "\$CONTAINER_ENV_VAR" > '$container_env_var' &&
touch "\${TMP:-/tmp}/job_tmp" &&
touch "\${TEMP:-/tmp}/job_temp" &&
Expand All @@ -26,6 +27,7 @@ touch "\${TMPDIR:-/tmp}/job_tmpdir"
<data name="tmp" format="txt" label="tmp" />
<data name="some_env_var" format="txt" label="env_var" />
<data name="jobconf_env_var" format="txt" label="jobconf_env_var" />
<data name="container_env_var" format="txt" label="container_env_var" />
</outputs>
<tests>
</tests>
Expand Down
1 change: 1 addition & 0 deletions test/integration/dockerized_job_conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ execution:
value: 'YEAH'
- execute: 'true' # just check that this does not confuse env setup
docker_enabled: true
docker_env_CONTAINER_VAR: "DOCKER_VAR_VALUE"
require_container: true
tmp_dir: '$(mktemp -d)'
local_docker_inline_container_resolvers:
Expand Down
1 change: 1 addition & 0 deletions test/integration/singularity_job_conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ execution:
- name: 'JOBCONF_ENV_VAR'
value: 'YEAH'
singularity_enabled: true
singularity_env_CONTAINER_VAR: "SINGULARITY_VAR_VALUE"
# Since tests run in /tmp/ , we apparently need to forbid the default mounting of /tmp
singularity_run_extra_arguments: '--no-mount tmp'
require_container: true
Expand Down
4 changes: 3 additions & 1 deletion test/integration/test_job_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"tmp",
"some_env",
"jobconf_env_var",
"container_env_var",
],
)

Expand Down Expand Up @@ -62,7 +63,8 @@ def _environment_properties(self, history_id):
tmp = self.dataset_populator.get_history_dataset_content(history_id, hid=5).strip()
some_env = self.dataset_populator.get_history_dataset_content(history_id, hid=6).strip()
jobconf_env_var = self.dataset_populator.get_history_dataset_content(history_id, hid=7).strip()
return JobEnvironmentProperties(user_id, group_id, pwd, home, tmp, some_env, jobconf_env_var)
container_env_var = self.dataset_populator.get_history_dataset_content(history_id, hid=7).strip()
return JobEnvironmentProperties(user_id, group_id, pwd, home, tmp, some_env, jobconf_env_var, container_env_var)

def _check_completed_history(self, history_id):
"""Extension point that lets subclasses investigate the completed job."""
Expand Down

0 comments on commit 0cac78a

Please sign in to comment.