Skip to content

Regression: Current best fails with Spicy test suite #122

@rsmmr

Description

@rsmmr

With current master, I get this when running the Spicy test suite:

> ~/work/zeek/btest/btest
No build directory; to run installation tests without build directory available set SPICY_INSTALLATION_DIRECTORY
No build directory; to run installation tests without build directory available set SPICY_INSTALLATION_DIRECTORY
No build directory; to run installation tests without build directory available set SPICY_INSTALLATION_DIRECTORY
No build directory; to run installation tests without build directory available set SPICY_INSTALLATION_DIRECTORY
No build directory; to run installation tests without build directory available set SPICY_INSTALLATION_DIRECTORY
No build directory; to run installation tests without build directory available set SPICY_INSTALLATION_DIRECTORY
No build directory; to run installation tests without build directory available set SPICY_INSTALLATION_DIRECTORY
[...]

v1.12 works and bisecting reveals #121 as the culprit. It seems the failure comes from the variables in [environment] not being available yet when we do the new interpolation check. The following patch makes it work, but I don't think it's correct either because the environment section might have interpolations of its own that aren't resolvable at that time yet. So not sure right now what the solution is.

diff --git a/btest b/btest
index 86d93b9..0a04e33 100755
--- a/btest
+++ b/btest
@@ -3111,6 +3111,11 @@ if __name__ == "__main__":
     Config = getcfgparser(defaults)
     Config.read(btest_cfg, encoding="utf-8")
 
+    if Config.has_section("environment"):
+        for name, value in Config.itemsNoDefaults("environment"):
+            # Here we don't want to include items from defaults
+            os.environ[name] = value
+
     # Make sure at this point that any Python-level %()s substitution patterns
     # resolve. Cleaner to error now than in mid-processing when we retrieve an
     # option. We use itemsNoDefaults() for this since falling back on defaults
@@ -3204,11 +3209,6 @@ if __name__ == "__main__":
 
     # Evaluate other command line options.
 
-    if Config.has_section("environment"):
-        for name, value in Config.itemsNoDefaults("environment"):
-            # Here we don't want to include items from defaults
-            os.environ[name] = value
-
     Alternatives = {}
 
     if Options.alternatives:

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions