diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-06-01 12:16:43 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-06-01 12:16:43 -0400 |
commit | 8fc1017d809c69943f0257902e4e408fc7b47cb9 (patch) | |
tree | bf0618f082c31f34e15d4de097f0ecf733177a7b /source/app.d | |
parent | 5505aa564eb741d6f024a176f9674db459b6a958 (diff) | |
download | dm-8fc1017d809c69943f0257902e4e408fc7b47cb9.tar.gz |
Refactor creation/test procedure
Diffstat (limited to 'source/app.d')
-rw-r--r-- | source/app.d | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/app.d b/source/app.d index 1fc3e32..4344492 100644 --- a/source/app.d +++ b/source/app.d @@ -5,6 +5,7 @@ import std.format; import std.file; import std.typecons; import std.path : buildPath, chainPath, absolutePath; +import std.range : enumerate; import conda; import merge; import session; @@ -100,20 +101,33 @@ int main(string[] args) { output_dir.mkdirRecurse; } + conda.activate(session.delivery); writeln("Creating YAML dump: " ~ dumpfile_yaml); conda.dump_env_yaml(dumpfile_yaml); writeln("Creating explicit dump: " ~ dumpfile_explicit); conda.dump_env_explicit(dumpfile_explicit); writeln("Creating pip-freeze dump: " ~ dumpfile_freeze); conda.dump_env_freeze(dumpfile_freeze); + conda.deactivate(); if (session.run_tests) { int failures = 0; string testdir = buildPath(output_dir, "testdir"); testable_t[] pkgs = testable_packages(conda, session.conda_requirements, session.test_filter_git_orgs); - foreach (pkg; pkgs) { + foreach (i, pkg; pkgs.enumerate(0)) { + string tmpenv = format("%04d_%s", i, session.delivery); + if(conda.run("create -n " ~ tmpenv ~ " --clone " ~ session.delivery)) { + return false; + } + conda.activate(tmpenv); + failures += integration_test(session, conda, testdir, pkg); + + conda.deactivate(); + if(conda.run("env remove -n " ~ tmpenv)) { + return false; + } } if (failures) { |