Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Fix path for installed apport-cli and fix test_run_crash_kernel on Azure #18

Merged
merged 3 commits into from Oct 7, 2022

Conversation

bdrung
Copy link
Collaborator

@bdrung bdrung commented Oct 5, 2022

Running the CLI UI tests against the install Apport fails:

Traceback (most recent call last):
[...]
  File "tests/integration/test_ui_cli.py", line 25, in <module>
    apport_cli = import_module_from_file(apport_cli_path)
  File "tests/helper.py", line 48, in import_module_from_file
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 879, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1016, in get_code
  File "<frozen importlib._bootstrap_external>", line 1073, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/apport/apport-cli'

The CLI is installed in /usr/bin/apport-cli.

The UI integration test case test_run_crash_kernel fails on Azure:

>       self.assertEqual(
            self.ui.opened_url,
            "http://%s.bugs.example.com/%i"
            % (src_pkg, self.ui.crashdb.latest_id()),
        )
E       AssertionError: 'http://linux-signed-azure.bugs.example.com/5' != 'http://linux-signed.bugs.example.com/5'
E       - http://linux-signed-azure.bugs.example.com/5
E       ?                    ------
E       + http://linux-signed.bugs.example.com/5

tests/integration/test_ui.py:1574: AssertionError

The kernel source package is named linux-signed-azure on Azure.

Ubuntu's autopkgtest runs the unit and integration tests against the installed system. Test this scenario in the CI as well.

@codecov
Copy link

codecov bot commented Oct 5, 2022

Codecov Report

Merging #18 (4fa4c8c) into main (05e2277) will increase coverage by 0.24%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
+ Coverage   79.46%   79.70%   +0.24%     
==========================================
  Files          77       77              
  Lines       17213    17215       +2     
==========================================
+ Hits        13678    13721      +43     
+ Misses       3535     3494      -41     
Impacted Files Coverage Δ
tests/integration/test_ui.py 96.18% <100.00%> (+0.60%) ⬆️
tests/integration/test_ui_cli.py 100.00% <100.00%> (+2.94%) ⬆️
tests/system/test_ui_gtk.py 97.53% <0.00%> (-0.16%) ⬇️
tests/integration/test_report.py 91.67% <0.00%> (+0.21%) ⬆️
tests/integration/test_signal_crashes.py 86.52% <0.00%> (+0.37%) ⬆️
tests/integration/test_packaging_apt_dpkg.py 99.59% <0.00%> (+0.40%) ⬆️
tests/integration/test_hookutils.py 93.10% <0.00%> (+2.41%) ⬆️
tests/integration/test_fileutils.py 98.40% <0.00%> (+5.11%) ⬆️
tests/integration/test_java_crashes.py 96.49% <0.00%> (+5.26%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Running the CLI UI tests against the install Apport fails:

```
Traceback (most recent call last):
[...]
  File "tests/integration/test_ui_cli.py", line 25, in <module>
    apport_cli = import_module_from_file(apport_cli_path)
  File "tests/helper.py", line 48, in import_module_from_file
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 879, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1016, in get_code
  File "<frozen importlib._bootstrap_external>", line 1073, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/apport/apport-cli'
```

The CLI is installed in `/usr/bin/apport-cli`.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
The UI integration test case `test_run_crash_kernel` fails on Azure:

```
>       self.assertEqual(
            self.ui.opened_url,
            "http://%s.bugs.example.com/%i"
            % (src_pkg, self.ui.crashdb.latest_id()),
        )
E       AssertionError: 'http://linux-signed-azure.bugs.example.com/5' != 'http://linux-signed.bugs.example.com/5'
E       - http://linux-signed-azure.bugs.example.com/5
E       ?                    ------
E       + http://linux-signed.bugs.example.com/5

tests/integration/test_ui.py:1574: AssertionError
```

The kernel source package is named `linux-signed-azure` on Azure.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
Ubuntu's autopkgtest runs the unit and integration tests against the
installed system. Test this scenario in the CI as well.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
@schopin-pro schopin-pro merged commit edff2be into canonical:main Oct 7, 2022
@bdrung bdrung deleted the unit-test-installed branch October 7, 2022 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants