-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Run tests folder as pytest cases
Signed-off-by: Jayson Reis <[email protected]>
- Loading branch information
1 parent
801faea
commit 807dc10
Showing
4 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pathlib | ||
import sys | ||
|
||
FOLDER_PARAMETER_NAME = "folder" | ||
HERE = pathlib.Path(__file__).parent | ||
ROOT = HERE / ".." | ||
TESTS_FOLDER = ROOT / "tests" | ||
|
||
sys.path.append(ROOT) | ||
|
||
|
||
def pytest_generate_tests(metafunc): | ||
if FOLDER_PARAMETER_NAME in metafunc.fixturenames: | ||
metafunc.parametrize(FOLDER_PARAMETER_NAME, get_fixtures_folder()) | ||
|
||
|
||
def get_fixtures_folder(): | ||
for folder in TESTS_FOLDER.glob("*"): | ||
if not folder.is_dir(): | ||
continue | ||
|
||
if not any(folder.glob("*-compose.y*ml")): | ||
continue | ||
|
||
yield str(folder.absolute()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import os | ||
import podman_compose | ||
|
||
def test_case_for(folder): | ||
os.chdir(folder) | ||
podman_compose.podman_compose.run(["build"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM scratch |