Skip to content

Commit efffcb9

Browse files
committed
fixed tests to work with latest yaml changes
1 parent 5f30236 commit efffcb9

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ jobs:
2929
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
3030
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
3131
}
32+
# Add Scoop shims to PATH for subsequent steps
33+
$scoopShims = "$env:USERPROFILE\scoop\shims"
34+
echo "$scoopShims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
3235
# Add Kopia bucket and install
3336
scoop bucket add kopia https://github.com/kopia/scoop-bucket.git
3437
scoop install kopia
38+
# Verify immediately (shims dir already in current session)
39+
& "$scoopShims\kopia.exe" --version
3540
3641
- name: Verify Kopia installation
3742
run: kopia --version

kopia_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ def load_config(config_path: Optional[str] = None, validate_sources: bool = True
400400
class KopiaRunner:
401401
"""Handles Kopia command execution and configuration."""
402402

403-
def __init__(self, config_path: Optional[str] = None):
404-
self.config = load_config(config_path)
403+
def __init__(self, config_path: Optional[str] = None, skip_config: bool = False):
404+
self.config = {} if skip_config else load_config(config_path)
405405
self._kopia_not_found_warned = False
406406

407407
def run(

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def temp_repo():
2424

2525
repo_config = {
2626
'name': 'test-repo',
27-
'repository_path': repo_path,
28-
'config_file_path': config_file,
27+
'local_destination_repo': repo_path,
28+
'local_config_file_path': config_file,
2929
'password': 'test-password',
3030
'sources': [source_dir]
3131
}

tests/test_integration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def import_script(name):
1919
class TestIntegration:
2020
def test_backup_lifecycle(self, temp_repo):
2121
"""Test init, backup, and find flow."""
22-
runner = utils.KopiaRunner()
22+
runner = utils.KopiaRunner(skip_config=True)
2323
repo_config = temp_repo['config']
2424
source_dir = temp_repo['source_dir']
2525

@@ -38,7 +38,7 @@ def test_backup_lifecycle(self, temp_repo):
3838

3939
# 3. Verify Snapshot exists
4040
success, stdout, _, _ = runner.run(
41-
["snapshot", "list", "--json", "--config-file", repo_config['config_file_path']],
41+
["snapshot", "list", "--json", "--config-file", repo_config['local_config_file_path']],
4242
repo_config=repo_config
4343
)
4444
assert success
@@ -51,7 +51,7 @@ def test_backup_lifecycle(self, temp_repo):
5151
assert matches[0]['size'] == 11 # "Hello Kopia" is 11 bytes
5252

5353
def test_incremental_backup(self, temp_repo):
54-
runner = utils.KopiaRunner()
54+
runner = utils.KopiaRunner(skip_config=True)
5555
repo_config = temp_repo['config']
5656
source_dir = temp_repo['source_dir']
5757

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_format_kopia_verbose_timestamp(self):
3737
assert clean_simple == "2025-11-22 16:09:30 +1100"
3838

3939
def test_get_password(self):
40-
runner = utils.KopiaRunner()
40+
runner = utils.KopiaRunner(skip_config=True)
4141

4242
# Test explicit config
4343
config = {'name': 'test', 'password': 'explicit-pass'}

0 commit comments

Comments
 (0)