Skip to content

Commit 5dbaff5

Browse files
committed
Update test to support config-dir and envs
1 parent 5e9eaad commit 5dbaff5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/deploy/__main__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,10 @@ def links() -> None:
122122
def test(args: tuple[str, ...]) -> None:
123123
import pytest
124124

125-
configpath = Path.cwd()
126-
config = load_config(configpath)
127-
plist = PackageList(configpath, config, prefix=Args.prefix)
125+
config = load_config(Args.config_dir)
126+
plist = PackageList(Args.config_dir, config, prefix=Args.prefix)
128127

129-
testpath = Path("./deploy_tests")
128+
testpath = Args.config_dir / "deploy_tests"
130129
if not testpath.is_dir():
131130
sys.exit(f"Test directory '{testpath}' doesn't exist or is not a directory")
132131

@@ -136,6 +135,9 @@ def test(args: tuple[str, ...]) -> None:
136135
for pkg in plist.packages.values():
137136
os.environ[f"{pkg.config.name}_version"] = pkg.config.version
138137

138+
for name, dest in plist.envs:
139+
os.environ[f"{name}_env"] = f"{Args.prefix / dest}"
140+
139141
print(f"{os.environ['PATH']=}")
140142
sys.exit(pytest.main([str(testpath), *args]))
141143

0 commit comments

Comments
 (0)