aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-08-27 16:10:29 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-08-27 16:10:29 -0400
commit0dbe4b36100f0c3ce969dd7494e019e0f812fdd9 (patch)
tree0fbf531487450822e24f4849e9af3ff07ffca92e /src
parente0392a04462888661d4d350818e378b7df2c8fd1 (diff)
downloadstasis-0dbe4b36100f0c3ce969dd7494e019e0f812fdd9.tar.gz
Force conda reactivation in test script
Diffstat (limited to 'src')
-rw-r--r--src/delivery.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/delivery.c b/src/delivery.c
index 524dd0a..71d2488 100644
--- a/src/delivery.c
+++ b/src/delivery.c
@@ -1787,24 +1787,15 @@ void delivery_tests_run(struct Delivery *ctx) {
exit(1);
}
- FILE *runner_fp;
- char *runner_filename = xmkstemp(&runner_fp, "w");
-
- fprintf(runner_fp, "#!/bin/bash\n"
- "eval `conda shell.posix reactivate`\n"
- "set -x\n"
- "%s\n",
- cmd);
- fclose(runner_fp);
- chmod(runner_filename, 0755);
-
puts(cmd);
- char runner_cmd[PATH_MAX] = {0};
- sprintf(runner_cmd, "%s", runner_filename);
+ char runner_cmd[0xFFFF] = {0};
+ sprintf(runner_cmd, "source %s/etc/profile.d/conda.sh\nsource %s/etc/profile.d/mamba.sh\nmamba activate ${CONDA_ENV_DEFAULT}\nset -x\n%s",
+ ctx->storage.conda_install_prefix,
+ ctx->storage.conda_install_prefix,
+ cmd);
status = shell(&proc, runner_cmd);
if (status) {
msg(STASIS_MSG_ERROR, "Script failure: %s\n%s\n\nExit code: %d\n", ctx->tests[i].name, ctx->tests[i].script, status);
- remove(runner_filename);
popd();
guard_free(cmd);
if (!globals.continue_on_error) {
@@ -1815,8 +1806,6 @@ void delivery_tests_run(struct Delivery *ctx) {
COE_CHECK_ABORT(1, "Test failure");
}
guard_free(cmd);
- remove(runner_filename);
- guard_free(runner_filename);
if (toxconf) {
remove(toxconf);
@@ -2228,4 +2217,4 @@ int delivery_exists(struct Delivery *ctx) {
guard_strlist_free(&files);
}
return 0; // not found
-} \ No newline at end of file
+}