-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Extract preparation of the CI environment into its own step and add that it creates the logging directory.
- Loading branch information
Showing
12 changed files
with
235 additions
and
224 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,23 @@ | ||
# Script-Languages-Container-CI 1.3.1, 2023-07-05 | ||
|
||
Code name: Fix bug during preparation of the CI environment | ||
|
||
## Summary | ||
|
||
This release fixes a bug during preparation of the CI environment. | ||
|
||
## Bug Fixes | ||
|
||
- #42: Fix bug during preparation of the CI environment | ||
|
||
## Features / Enhancements | ||
|
||
n/a | ||
|
||
## Documentation | ||
|
||
n/a | ||
|
||
## Refactoring | ||
|
||
n/a |
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,13 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
from exasol_integration_test_docker_environment.cli.options.system_options import DEFAULT_OUTPUT_DIRECTORY | ||
from exasol_integration_test_docker_environment.lib.base import luigi_log_config | ||
|
||
|
||
class CIPrepare: | ||
|
||
def prepare(self): | ||
log_path = Path(DEFAULT_OUTPUT_DIRECTORY) / "jobs" / "logs" / "main.log" | ||
log_path.mkdir(parents=True, exist_ok=True) | ||
os.environ[luigi_log_config.LOG_ENV_VARIABLE_NAME] = f"{log_path.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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,27 @@ | ||
import os | ||
from pathlib import Path | ||
from unittest import mock | ||
|
||
import pytest | ||
from exasol_integration_test_docker_environment.cli.options.system_options import DEFAULT_OUTPUT_DIRECTORY | ||
from exasol_integration_test_docker_environment.lib.base import luigi_log_config | ||
|
||
from exasol_script_languages_container_ci.lib.ci_prepare import CIPrepare | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def mock_settings_env_vars(): | ||
with mock.patch.dict(os.environ, {}): | ||
yield | ||
|
||
|
||
def test_ci_prepare_log_environment_variable_is_set(): | ||
CIPrepare().prepare() | ||
expected_log_path = str(Path(DEFAULT_OUTPUT_DIRECTORY) / "jobs" / "logs" / "main.log") | ||
assert luigi_log_config.LOG_ENV_VARIABLE_NAME in os.environ \ | ||
and os.environ[luigi_log_config.LOG_ENV_VARIABLE_NAME].endswith(expected_log_path) | ||
|
||
|
||
def test_ci_prepare_log_path_exists(): | ||
CIPrepare().prepare() | ||
assert Path(os.environ[luigi_log_config.LOG_ENV_VARIABLE_NAME]).parent.is_dir() |
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