Skip to content

Commit 8a789ee

Browse files
committed
Merge branch 'bundle-local-resource-with-path' into unit-test-fix
2 parents 3946a78 + 2522081 commit 8a789ee

8 files changed

Lines changed: 28 additions & 11 deletions

File tree

juju/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,7 @@ async def add_local_resources(self, application, entity_url, metadata, resources
18581858
'description': '',
18591859
'fingerprint': '',
18601860
'name': name,
1861-
'path': path,
1861+
'path': Path(path).name,
18621862
'revision': 0,
18631863
'size': 0,
18641864
'type_': resource_type,

tests/bundle/mini-bundle.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
series: xenial
21
applications:
32
ghost:
43
charm: "ghost"
54
channel: stable
65
num_units: 1
76
mysql:
87
charm: "mysql"
9-
channel: stable
8+
channel: candidate
109
num_units: 1
1110
relations:
1211
- ["ghost", "mysql"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
applications:
2+
file-resource-charm:
3+
charm: ./file-resource-charm
4+
num_units: 1
5+
resources:
6+
file-res: ./file-resource-charm/test.file

tests/integration/bundle/bundle-include-file.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
series: xenial
21
applications:
32
ghost:
43
charm: "ghost"
@@ -8,7 +7,7 @@ applications:
87
config: include-file://config1.yaml
98
mysql:
109
charm: "mysql"
11-
channel: stable
10+
channel: candidate
1211
num_units: 1
1312
test:
1413
charm: "../charm"

tests/integration/bundle/test-overlays/bundle-with-overlay-multi.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
series: xenial
21
applications:
32
ghost:
43
charm: "ghost"
54
channel: stable
65
num_units: 1
76
mysql:
87
charm: "mysql"
9-
channel: stable
8+
channel: candidate
109
num_units: 1
1110
relations:
1211
- ["ghost", "mysql"]

tests/integration/bundle/test-overlays/test-multi-overlay.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ applications:
1111
memcached:
1212
mysql:
1313
charm: "mysql"
14-
channel: stable
14+
channel: candidate
1515
num_units: 1

tests/integration/bundle/test-overlays/test-overlay.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ applications:
77
num_units: 1
88
mysql:
99
charm: "mysql"
10-
channel: stable
10+
channel: candidate
1111
num_units: 1
1212
relations:
1313
- ["ghost", "mysql"]

tests/integration/test_model.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
MB = 1
2424
GB = 1024
2525
SSH_KEY = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsYMJGNGG74HAJha3n2CFmWYsOOaORnJK6VqNy86pj0MIpvRXBzFzVy09uPQ66GOQhTEoJHEqE77VMui7+62AcMXT+GG7cFHcnU8XVQsGM6UirCcNyWNysfiEMoAdZScJf/GvoY87tMEszhZIUV37z8PUBx6twIqMdr31W1J0IaPa+sV6FEDadeLaNTvancDcHK1zuKsL39jzAg7+LYjKJfEfrsQP+lj/EQcjtKqlhVS5kzsJVfx8ZEd0xhW5G7N6bCdKNalS8mKCMaBXJpijNQ82AiyqCIDCRrre2To0/i7pTjRiL0U9f9mV3S4NJaQaokR050w/ZLySFf6F7joJT mathijs@Qrama-Mathijs' # noqa
26-
HERE_DIR = Path(__file__).absolute().parent
27-
TESTS_DIR = HERE_DIR.parent
26+
HERE_DIR = Path(__file__).absolute().parent # tests/integration
27+
TESTS_DIR = HERE_DIR.parent # tests/
2828
OVERLAYS_DIR = HERE_DIR / 'bundle' / 'test-overlays'
2929

3030

@@ -61,6 +61,20 @@ async def test_deploy_local_bundle_file(event_loop):
6161
timeout=60 * 4)
6262

6363

64+
@base.bootstrapped
65+
@pytest.mark.asyncio
66+
async def test_deploy_bundle_local_resource_relative_path(event_loop):
67+
bundle_file_path = HERE_DIR / 'bundle-file-resource.yaml'
68+
69+
async with base.CleanModel() as model:
70+
await model.deploy(str(bundle_file_path))
71+
72+
app = model.applications.get('file-resource-charm')
73+
assert app
74+
await model.block_until(lambda: (len(app.units) == 1),
75+
timeout=60 * 4)
76+
77+
6478
@base.bootstrapped
6579
@pytest.mark.asyncio
6680
async def test_deploy_local_bundle_include_file(event_loop):

0 commit comments

Comments
 (0)