Skip to content

Commit eb73a48

Browse files
author
Juan Tirado
committed
Fixes in integration tests.
1 parent 2bb24b6 commit eb73a48

14 files changed

Lines changed: 155 additions & 141 deletions

.github/workflows/test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ jobs:
1919
uses: actions/setup-python@v2
2020
with:
2121
python-version: ${{ matrix.python }}
22+
- name: Install dependencies
23+
run: pip install tox
2224
- name: Run unit tests
23-
run: tox -e py3
25+
run: tox -e py3,serial
2426

2527

2628
integration:
@@ -40,13 +42,11 @@ jobs:
4042
with:
4143
provider: lxd
4244
juju-channel: 3.0/stable
43-
#channel: 1.25-strict/stable
44-
#microk8s-group: snap_microk8s
4545
- name: Setup Python
4646
uses: actions/setup-python@v2
4747
with:
4848
python-version: ${{ matrix.python }}
4949
- name: Install dependencies
5050
run: pip install tox
5151
- name: Run integration
52-
run: tox -e py3 -e integration,serial
52+
run: tox -e integration

tests/bundle/mini-bundle.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
applications:
22
ghost:
3-
charm: "ghost"
3+
charm: "hello-juju"
44
channel: stable
55
num_units: 1
66
mysql:
7-
charm: "mysql"
7+
charm: "postgresql"
88
channel: candidate
99
num_units: 1
1010
relations:
11-
- ["ghost", "mysql"]
11+
- ["hello-juju", "postgresql"]
Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
1-
series: xenial
1+
# series: xenial
2+
# applications:
3+
# ghost:
4+
# charm: "ghost"
5+
# num_units: 1
6+
# mysql:
7+
# charm: "mysql"
8+
# channel: candidate
9+
# num_units: 1
10+
# options:
11+
# max-connections: 2
12+
# tuning-level: include-base64://config-base64.yaml
13+
# test:
14+
# charm: "../charm"
15+
# relations:
16+
# - ["ghost", "mysql"]
17+
218
applications:
3-
ghost:
4-
charm: "ghost"
5-
num_units: 1
6-
mysql:
7-
charm: "mysql"
8-
channel: candidate
19+
helloa:
20+
charm: "hello-juju"
21+
name: "helloa"
22+
channel: stable
923
num_units: 1
1024
options:
11-
max-connections: 2
12-
tuning-level: include-base64://config-base64.yaml
25+
application-repo: include-base64://config-base64.yaml
26+
hellob:
27+
charm: "hello-juju"
28+
name: "hellob"
29+
channel: stable
30+
num_units: 1
1331
test:
14-
charm: "../charm"
15-
relations:
16-
- ["ghost", "mysql"]
32+
charm: "../charm"
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
applications:
2-
ghost:
3-
charm: "ghost"
2+
helloa:
3+
charm: "hello-juju"
4+
name: "helloa"
45
channel: stable
56
num_units: 1
67
options:
78
config: include-file://config1.yaml
8-
mysql:
9-
charm: "mysql"
10-
channel: candidate
9+
hellob:
10+
charm: "hello-juju"
11+
name: "hellob"
12+
channel: stable
1113
num_units: 1
1214
test:
1315
charm: "../charm"
14-
relations:
15-
- ["ghost", "mysql"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ZmFzdA==
1+
aHR0cDovL215LWp1anUuY29t
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ghost:
2-
url: "http://my-ghost.blg"
3-
port: 2369
1+
helloa:
2+
application-repo: "http://my-juju.com"
3+
port: 666

tests/integration/file-resource-charm/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: file-resource-charm
2-
series: ["focal"]
2+
series: ["jammy"]
33
summary: "test local file resource"
44
description: "charm for test deploy local file resource"
55
maintainers: ["test"]

tests/integration/test_connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ async def test_monitor_catches_error(event_loop):
5959
async def test_full_status(event_loop):
6060
async with base.CleanModel() as model:
6161
await model.deploy(
62-
'cs:ubuntu-0',
62+
'ubuntu',
6363
application_name='ubuntu',
64-
series='trusty',
64+
series='focal',
6565
channel='stable',
6666
)
6767

tests/integration/test_crossmodel.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
async def test_offer(event_loop):
1414
async with base.CleanModel() as model:
1515
await model.deploy(
16-
'cs:~jameinel/ubuntu-lite-7',
16+
'ubuntu',
1717
application_name='ubuntu',
1818
series='focal',
1919
channel='stable',
@@ -35,7 +35,7 @@ async def test_offer(event_loop):
3535
async def test_consume(event_loop):
3636
async with base.CleanModel() as model_1:
3737
await model_1.deploy(
38-
'cs:~jameinel/ubuntu-lite-7',
38+
'ubuntu',
3939
application_name='ubuntu',
4040
series='focal',
4141
channel='stable',
@@ -66,7 +66,7 @@ async def test_consume(event_loop):
6666
async def test_remove_saas(event_loop):
6767
async with base.CleanModel() as model_1:
6868
await model_1.deploy(
69-
'cs:~jameinel/ubuntu-lite-7',
69+
'ubuntu',
7070
application_name='ubuntu',
7171
series='focal',
7272
channel='stable',
@@ -97,48 +97,48 @@ async def test_remove_saas(event_loop):
9797
@base.bootstrapped
9898
@pytest.mark.asyncio
9999
async def test_relate_with_offer(event_loop):
100-
pytest.skip('Revise: intermittent problem with the remove_saas call')
100+
# pytest.skip('Revise: intermittent problem with the remove_saas call')
101101
async with base.CleanModel() as model_1:
102102
application = await model_1.deploy(
103-
'ch:mysql',
104-
application_name='mysql',
105-
series='xenial',
103+
'postgresql',
104+
application_name='postgresql',
105+
series='focal',
106106
channel='stable',
107107
)
108-
assert 'mysql' in model_1.applications
108+
assert 'postgresql' in model_1.applications
109109
await model_1.wait_for_idle(status="active")
110-
await model_1.create_offer("mysql:db")
110+
await model_1.create_offer("postgresql:db")
111111

112112
offers = await model_1.list_offers()
113113
await model_1.block_until(
114-
lambda: all(offer.application_name == 'mysql'
114+
lambda: all(offer.application_name == 'postgresql'
115115
for offer in offers.results))
116116

117117
# farm off a new model to test the consumption
118118
async with base.CleanModel() as model_2:
119119
await model_2.deploy(
120-
'ch:mediawiki',
121-
application_name='mediawiki',
122-
series='trusty',
120+
'hello-juju',
121+
application_name='hello-juju',
122+
series='focal',
123123
channel='stable',
124124
)
125125
await model_2.block_until(
126126
lambda: all(unit.agent_status == 'idle'
127127
for unit in application.units))
128128

129-
await model_2.relate("mediawiki:db", "admin/{}.mysql".format(model_1.name))
129+
await model_2.relate("hello-juju:db", "admin/{}.postgresql".format(model_1.name))
130130
status = await model_2.get_status()
131-
if 'mysql' not in status.remote_applications:
131+
if 'postgresql' not in status.remote_applications:
132132
raise Exception("Expected mysql in saas")
133133

134-
await model_2.remove_saas('mysql')
134+
await model_2.remove_saas('postgresql')
135135
await jasyncio.sleep(5)
136136

137137
status = await model_2.get_status()
138-
if 'mysql' in status.remote_applications:
138+
if 'postgresql' in status.remote_applications:
139139
raise Exception("Expected mysql not to be in saas")
140140

141-
await model_1.remove_offer("admin/{}.mysql".format(model_1.name), force=True)
141+
await model_1.remove_offer("admin/{}.postgresql".format(model_1.name), force=True)
142142

143143

144144
@base.bootstrapped

tests/integration/test_macaroon_auth.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818

1919

2020
# this test must be run serially because it modifies the login password
21-
@pytest.mark.serial
2221
@base.bootstrapped
23-
@pytest.mark.asyncio
22+
@pytest.mark.serial
2423
@pytest.mark.skip('one of old macaroon_auth tests, needs to be revised')
2524
async def test_macaroon_auth_serial(event_loop):
2625
jujudata = FileJujuData()

0 commit comments

Comments
 (0)