55import time
66import uuid
77from concurrent .futures import ThreadPoolExecutor
8- from pathlib import Path
98
109import mock
1110import paramiko
1918from juju .utils import block_until , run_with_interrupt , wait_for_bundle , base_channel_to_series
2019
2120from .. import base
22-
23- MB = 1
24- GB = 1024
25- 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 # tests/integration
27- TESTS_DIR = HERE_DIR .parent # tests/
28- OVERLAYS_DIR = HERE_DIR / 'bundle' / 'test-overlays'
21+ from ..utils import MB , GB , TESTS_DIR , OVERLAYS_DIR , SSH_KEY , INTEGRATION_TEST_DIR
2922
3023
3124@base .bootstrapped
@@ -81,7 +74,7 @@ async def test_deploy_local_bundle_file(event_loop):
8174@base .bootstrapped
8275@pytest .mark .asyncio
8376async def test_deploy_bundle_local_resource_relative_path (event_loop ):
84- bundle_file_path = HERE_DIR / 'bundle-file-resource.yaml'
77+ bundle_file_path = INTEGRATION_TEST_DIR / 'bundle-file-resource.yaml'
8578
8679 async with base .CleanModel () as model :
8780 await model .deploy (str (bundle_file_path ))
@@ -134,7 +127,7 @@ async def test_deploy_by_revision_validate_flags(event_loop):
134127@base .bootstrapped
135128@pytest .mark .asyncio
136129async def test_deploy_local_bundle_include_file (event_loop ):
137- bundle_dir = TESTS_DIR / 'integration' / 'bundle'
130+ bundle_dir = INTEGRATION_TEST_DIR / 'bundle'
138131 bundle_yaml_path = bundle_dir / 'bundle-include-file.yaml'
139132
140133 async with base .CleanModel () as model :
@@ -151,7 +144,7 @@ async def test_deploy_local_bundle_include_file(event_loop):
151144@base .bootstrapped
152145@pytest .mark .asyncio
153146async def test_deploy_local_bundle_include_base64 (event_loop ):
154- bundle_dir = TESTS_DIR / 'integration' / 'bundle'
147+ bundle_dir = INTEGRATION_TEST_DIR / 'bundle'
155148 bundle_yaml_path = bundle_dir / 'bundle-include-base64.yaml'
156149
157150 async with base .CleanModel () as model :
@@ -167,7 +160,7 @@ async def test_deploy_local_bundle_include_base64(event_loop):
167160@base .bootstrapped
168161@pytest .mark .asyncio
169162async def test_deploy_bundle_local_charms (event_loop ):
170- bundle_path = TESTS_DIR / 'integration' / 'bundle' / 'local.yaml'
163+ bundle_path = INTEGRATION_TEST_DIR / 'bundle' / 'local.yaml'
171164
172165 async with base .CleanModel () as model :
173166 await model .deploy (bundle_path )
@@ -211,7 +204,7 @@ async def test_deploy_charm_assumes(event_loop):
211204@base .bootstrapped
212205@pytest .mark .asyncio
213206async def test_deploy_local_charm_base_charmcraft_yaml (event_loop ):
214- charm_path = HERE_DIR / 'charm-base-charmcraft-yaml'
207+ charm_path = INTEGRATION_TEST_DIR / 'charm-base-charmcraft-yaml'
215208
216209 async with base .CleanModel () as model :
217210 await model .deploy (str (charm_path ))
@@ -739,7 +732,7 @@ async def test_local_oci_image_resource_charm(event_loop):
739732@base .bootstrapped
740733@pytest .mark .asyncio
741734async def test_local_file_resource_charm (event_loop ):
742- charm_path = TESTS_DIR / 'integration' / 'file-resource-charm'
735+ charm_path = INTEGRATION_TEST_DIR / 'file-resource-charm'
743736 async with base .CleanModel () as model :
744737 resources = {"file-res" : "test.file" }
745738 app = await model .deploy (str (charm_path ), resources = resources )
@@ -777,7 +770,7 @@ async def test_attach_resource(event_loop):
777770async def test_store_resources_bundle (event_loop ):
778771 pytest .skip ('test_store_resources_bundle intermittent test failure' )
779772 async with base .CleanModel () as model :
780- bundle = str ( Path ( __file__ ). parent / 'bundle' )
773+ bundle = INTEGRATION_TEST_DIR / 'bundle'
781774 await model .deploy (bundle )
782775 assert 'ghost' in model .applications
783776 ghost = model .applications ['ghost' ]
@@ -799,7 +792,7 @@ async def test_store_resources_bundle(event_loop):
799792async def test_store_resources_bundle_revs (event_loop ):
800793 pytest .skip ('test_store_resources_bundle_revs intermittent test failure' )
801794 async with base .CleanModel () as model :
802- bundle = str ( Path ( __file__ ). parent / 'bundle/bundle-resource-rev.yaml' )
795+ bundle = INTEGRATION_TEST_DIR / 'bundle/bundle-resource-rev.yaml'
803796 await model .deploy (bundle )
804797 assert 'ghost' in model .applications
805798 ghost = model .applications ['ghost' ]
0 commit comments