Skip to content

Commit

Permalink
fixup: init
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Basti <mbasti@redhat.com>
  • Loading branch information
MartinBasti committed Oct 31, 2024
1 parent 50513c8 commit 856f9ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion atomic_reactor/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@
# Cachi2 constants
CACHI2_BUILD_DIR = "_cachi2_remote_sources"
CACHI2_BUILD_APP_DIR = "app"
CACHI2_BUILD_DEP_DIR = "deps"
CACHI2_PKG_OPTIONS_FILE = "cachi2_pkg_options.json"
CACHI2_FOR_OUTPUT_DIR_OPT_FILE = "cachi2_for_output_dir_opt.txt"
CACHI2_SINGLE_REMOTE_SOURCE_NAME = "remote-source"
Expand Down
5 changes: 2 additions & 3 deletions atomic_reactor/plugins/cachi2_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
PLUGIN_CACHI2_INIT,
CACHI2_BUILD_DIR,
CACHI2_BUILD_APP_DIR,
CACHI2_BUILD_DEP_DIR,
CACHI2_PKG_OPTIONS_FILE,
CACHI2_FOR_OUTPUT_DIR_OPT_FILE,
CACHI2_SINGLE_REMOTE_SOURCE_NAME,
Expand Down Expand Up @@ -148,9 +147,9 @@ def write_cachi2_for_output_dir(self, remote_source_name: str, path: Path):
This must be path inside container so users have the right paths to
use it within image build
"""
value = os.path.join(REMOTE_SOURCE_DIR, CACHI2_BUILD_DEP_DIR)
value = Path(REMOTE_SOURCE_DIR)
if self.multiple_remote_sources_params:
value = os.path.join(REMOTE_SOURCE_DIR, remote_source_name, CACHI2_BUILD_DEP_DIR)
value = value / remote_source_name

with open(path, 'w') as f:
f.write(str(value))
6 changes: 3 additions & 3 deletions tests/plugins/test_cachi2_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_single_remote_source_initialization(workflow, mocked_cachi2_init):
workflow,
CACHI2_SINGLE_REMOTE_SOURCE_NAME,
{"packages": [{"path": ".", "type": "gomod"}], "flags": []},
'/remote-source/deps')
'/remote-source')

assert result == [{
"name": "",
Expand Down Expand Up @@ -183,12 +183,12 @@ def test_multi_remote_source_initialization(workflow, mocked_cachi2_init):
"packages": [{"path": ".", "type": "gomod"}],
"flags": ["gomod-vendor"]
},
f'/remote-source/{first_remote_source_name}/deps')
f'/remote-source/{first_remote_source_name}')
assert_cachi2_init_files(
workflow,
second_remote_source_name,
{"packages": [{"path": ".", "type": "gomod"}], "flags": []},
f'/remote-source/{second_remote_source_name}/deps')
f'/remote-source/{second_remote_source_name}')

assert result == [{
"name": first_remote_source_name,
Expand Down

0 comments on commit 856f9ea

Please sign in to comment.