aboutsummaryrefslogtreecommitdiff
path: root/source/merge.d
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2019-06-03 12:55:44 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2019-06-03 12:55:44 -0400
commitcf109a47bbcb789b8721deecf798cbeaa0b220a1 (patch)
treeede95b4ce497faaade5dd346e2f2ec0a1addb476 /source/merge.d
parent8f8960e1ca30a44b00688691cc9688b0d2a14cd9 (diff)
downloaddm-cf109a47bbcb789b8721deecf798cbeaa0b220a1.tar.gz
Implement extended testing
Diffstat (limited to 'source/merge.d')
-rw-r--r--source/merge.d26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/merge.d b/source/merge.d
index fa625c8..0b55f92 100644
--- a/source/merge.d
+++ b/source/merge.d
@@ -165,6 +165,7 @@ int integration_test(ref Session_t session,
import std.random : randomSample;
import std.utf : byCodeUnit;
+ TestExtended_t te;
auto id = letters.byCodeUnit.randomSample(6).to!string;
string basetemp = tempDir.buildPath("dm_testable_" ~ id);
basetemp.mkdir;
@@ -206,6 +207,21 @@ int integration_test(ref Session_t session,
}
}
+ // Retrieve extended test data for this package
+ foreach (TestExtended_t t; session.test_extended) {
+ if (repo_root.baseName == t.name) {
+ te = t;
+ break;
+ }
+ }
+
+ // Inject extended runtime environment early.
+ // a pip-installed package might need something.
+ foreach (string k, string v; te.runtime) {
+ te.runtime[k] = interpolate(conda.env, v).dup;
+ conda.env[k] = te.runtime[k];
+ }
+
if (!session.test_pip_requirements.empty) {
if (conda.sh("python -m pip install "
~ conda.multiarg("-i", session.pip_index) ~ " "
@@ -233,8 +249,16 @@ int integration_test(ref Session_t session,
File(pytest_cfg, "w+").write(data);
}
+ // Execute extended commands
+ foreach (string cmd; te.commands) {
+ conda.sh(interpolate(conda.env, cmd));
+ }
+
+ // Run tests
if (conda.sh(session.test_program ~ " "
- ~ session.test_args ~ " --basetemp=" ~ basetemp)) {
+ ~ session.test_args ~ " "
+ ~ te.test_args ~ " "
+ ~ " --basetemp=" ~ basetemp)) {
return 1;
}
return 0;