summaryrefslogtreecommitdiff
diff options
authorCelia Wang <celia.wang@canonical.com>2020-05-22 01:48:52 +0000
committerCelia Wang <celia.wang@canonical.com>2020-05-22 01:48:52 +0000
commit431fb7acbf07cb714dea642b56e8eebb4eaa7378 (patch)
tree7f5ec6ab6dc4ce864f4456cd45c26fc3dc6ec906
parenta47d77a2eea582277ad47e0f245b1d6fed204640 (diff)
Fix unit test and add focal functional test
-rw-r--r--tests/bundles/focal.yaml8
-rw-r--r--tests/tests.yaml4
-rw-r--r--tox.ini2
-rw-r--r--unit_tests/test_hooks.py2
4 files changed, 13 insertions, 3 deletions
diff --git a/tests/bundles/focal.yaml b/tests/bundles/focal.yaml
new file mode 100644
index 0000000..e485f5e
--- /dev/null
+++ b/tests/bundles/focal.yaml
@@ -0,0 +1,8 @@
+series: focal
+description: "mongodb-charm test bundle"
+applications:
+ mongodb:
+ num_units: 3
+ options:
+ replicaset: testset
+ backup_directory: /var/backups
diff --git a/tests/tests.yaml b/tests/tests.yaml
index 2f157ec..6b608b2 100644
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -7,11 +7,15 @@ tests:
- model_alias_bionic:
- tests.tests_mongodb.BasicMongodbCharmTest
- tests.tests_mongodb.ReplicatedMongodbCharmTest
+ - model_alias_focal:
+ - tests.tests_mongodb.BasicMongodbCharmTest
+ - tests.tests_mongodb.ReplicatedMongodbCharmTest
- model_alias_shard:
- tests.tests_mongodb.ShardedMongodbCharmTest
gate_bundles:
- model_alias_xenial: xenial
- model_alias_bionic: bionic
+ - model_alias_focal: focal
- model_alias_shard: bionic-shard
smoke_bundles:
- model_alias_bionic: bionic
diff --git a/tox.ini b/tox.ini
index 0306cab..79437a2 100644
--- a/tox.ini
+++ b/tox.ini
@@ -24,13 +24,11 @@ commands =
deps = -r{toxinidir}/test_requirements.txt
[testenv:functional]
-basepython = python3
commands =
functest-run-suite --keep-model
deps = -r{toxinidir}/tests/test_requirements.txt
[testenv:func-smoke]
-basepython = python3
commands =
functest-run-suite --keep-model --smoke
deps = -r{toxinidir}/tests/test_requirements.txt
diff --git a/unit_tests/test_hooks.py b/unit_tests/test_hooks.py
index 661ae7c..e97ef91 100644
--- a/unit_tests/test_hooks.py
+++ b/unit_tests/test_hooks.py
@@ -248,7 +248,7 @@ class MongoHooksTest(CharmTestCase):
self.assertEqual(0, mock_check_output.call_count)
mock_check_output.reset_mock()
- mock_check_output.return_value = '{"ok": 1}'
+ mock_check_output.return_value = b'{"ok": 1}'
rv = hooks.mongo_client_smart(command='fake-cmd')
self.assertTrue(rv)