Merge ~xavpaice/charm-grafana:fix_unit_tests_ci into charm-grafana:master

Proposed by Xav Paice
Status: Merged
Approved by: Alvaro Uria
Approved revision: cf8429a3add01f14f4fa5dc781f48988cc46a867
Merged at revision: bd7473c7a624719123a45a3e1571b390a3ad2954
Proposed branch: ~xavpaice/charm-grafana:fix_unit_tests_ci
Merge into: charm-grafana:master
Diff against target: 22 lines (+3/-7)
1 file modified
src/tests/unit/test_grafana.py (+3/-7)
Reviewer Review Type Date Requested Status
Alvaro Uria Approve
prod-jenkaas-bootstack (community) continuous-integration Approve
Xiyue Wang Approve
Review via email: mp+404052@code.launchpad.net

Commit message

Change list of packages tested in unit tests

Reduces the list of packages used for testing the package version
getting method, to packages that we are sure are installed in the test
environment.

To post a comment you must log in.
Revision history for this message
Canonical IS Mergebot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
Xiyue Wang (ziyiwang) wrote :

LGTM

review: Approve
Revision history for this message
prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alvaro Uria (aluria) wrote :

This test checks the get_installed_package_version function. The test runs "apt list --installed" and the tested function uses "apt-cache policy" and looks for the "Installed: <version>" line.

Since both tox and python3 are installed via apt (to run jobs in jenkins), I think this test looks good.

Thanks.

review: Approve
Revision history for this message
Canonical IS Mergebot (canonical-is-mergebot) wrote :

Change successfully merged at revision bd7473c7a624719123a45a3e1571b390a3ad2954

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/tests/unit/test_grafana.py b/src/tests/unit/test_grafana.py
index b0936c9..2645b53 100644
--- a/src/tests/unit/test_grafana.py
+++ b/src/tests/unit/test_grafana.py
@@ -26,14 +26,10 @@ class GrafanaTestCase(unittest.TestCase):
2626
27 def test_get_installed_package_version(self):27 def test_get_installed_package_version(self):
28 """Test get_installed_package_version with basic packages."""28 """Test get_installed_package_version with basic packages."""
29 # these packages are installed by layer:basic29 # these packages are sure to be installed or we can't run tests
30 packages = [30 packages = [
31 "python3-pip",31 "python3",
32 "python3-setuptools",32 "tox",
33 "python3-yaml",
34 "python3-dev",
35 "python3-wheel",
36 "build-essential",
37 ]33 ]
38 for package in packages:34 for package in packages:
39 # get the version with a different cmd35 # get the version with a different cmd

Subscribers

People subscribed via source and target branches