KenKundert / emborg

Interactive command line interface to Borg Backup
GNU General Public License v3.0
94 stars 8 forks source link

Tests fail on v1.36 #71

Closed adhawkins closed 1 year ago

adhawkins commented 1 year ago

Hi

Packaging up 1.36 for Alpine, and realised I hadn't enabled the tests. When I do, one is failing:

_________________________ test_emborg_with_configs[24] _________________________

initialize_configs = Info(
    borg_version=(1, 2, 4),
    fuse_is_missing=True,
)
name = 'magnate', args = '--quiet due'
expected = {'exit_status': 0, 'output': '\n        test0: (just now|(\\d+ )?(seconds|minutes)) since last backup\\.\n        test...+ )?(seconds|minutes)) since last backup\\.\n        test3: (just now|(\\d+ )?(seconds|minutes)) since last backup\\.'}
expected_type = 'regex', cmp_dirs = '', remove = '', dependencies = ''

    @parametrize(
        path = f'{tests_dir}/test-cases.nt',
        key = 'emborg with configs',
        schema = emborg_schema
    )
    def test_emborg_with_configs(
        initialize_configs,
        name, args, expected, expected_type, cmp_dirs, remove, dependencies
    ):
        skip_test_if_missing_dependencies(initialize_configs, dependencies)
        with cd(tests_dir):
            tester = EmborgTester(args, expected, expected_type, cmp_dirs, remove)
            passes = tester.run()
            if not passes:
                result = tester.get_result()
                expected = tester.get_expected()
>               assert result == expected, f"Test ‘{name}’ fails."
E               AssertionError: Test ‘magnate’ fails.
E               assert {'exit_status...last backup.'} == {'exit_status...st backup\\.'}
E                 Omitting 1 identical items, use -vv to show
E                 Differing items:
E                 {'output': '\n        test0: 1.4 minutes since last backup.\n        test1: 1.2 minutes since last backup.\n        test2: 56 seconds since last backup.\n        test3: 35 seconds since last backup.'} != {'output': '\n        test0: (just now|(\\d+ )?(seconds|minutes)) since last backup\\.\n        test1: (just now|(\\d+...+ )?(seconds|minutes)) since last backup\\.\n        test3: (just now|(\\d+ )?(seconds|minutes)) since last backup\\.'}
E                 Use -v to get more diff

tests/test_emborg.py:254: AssertionError
----------------------------- Captured stdout call -----------------------------
test0: 1.4 minutes since last backup.
test1: 1.2 minutes since last backup.
test2: 56 seconds since last backup.
test3: 35 seconds since last backup.

It's possible this has been failing for a while, as I wasn't running the tests when building

KenKundert commented 1 year ago

Sorry about that. I am surprised I did not see this issue myself. The problem is in the test itself rather than being in Emborg, so while I have checked a fix into GitHub, you probably don't need to bother installing it.

KenKundert commented 1 year ago

Just so you know, with the upcoming release of Borg 2.0 I will be making some extensive changes to Emborg. Most obvious will be that I will be moving to a new config file format (NestedText) and I will be renaming the program to Assimilate (more in the Borg theme).

adhawkins commented 1 year ago

Just so you know, with the upcoming release of Borg 2.0 I will be making some extensive changes to Emborg. Most obvious will be that I will be moving to a new config file format (NestedText) and I will be renaming the program to Assimilate (more in the Borg theme).

Thanks for the heads up. I'll check with the Alpine devs how to go about renaming a package once this happens. Good luck with the changes.

KenKundert commented 1 year ago

Someone else reported a missing dependency. The tests pass because it was installed for testing.

As a result I releasing a new version.