Skip to content

Commit

Permalink
#140 Fixed the localstack fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Sep 25, 2024
1 parent aa43c26 commit 691fc73
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ jobs:
- name: SCM Checkout
uses: actions/checkout@v4

- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
large-packages: false
# - name: Free disk space
# uses: jlumbroso/free-disk-space@main
# with:
# tool-cache: true
# large-packages: false

- name: Free disk space by removing large directories
run: |
sudo rm -rf /usr/local/graalvm/
sudo rm -rf /usr/local/.ghcup/
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /opt/ghc
# - name: Free disk space by removing large directories
# run: |
# sudo rm -rf /usr/local/graalvm/
# sudo rm -rf /usr/local/.ghcup/
# sudo rm -rf /usr/local/share/powershell
# sudo rm -rf /usr/local/share/chromium
# sudo rm -rf /usr/local/lib/node_modules
# sudo rm -rf /opt/ghc

- name: Setup Python & Poetry Environment
uses: ./.github/actions/prepare_poetry_env
Expand Down
7 changes: 3 additions & 4 deletions tests/fixtures/localstack_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
@pytest.fixture(scope='session')
def run_localstack(backend_aware_onprem_database) -> tuple[str, str] | None:
if backend_aware_onprem_database is not None:
db_info = backend_aware_onprem_database.database_info
container_info = db_info.container_info
container_info = backend_aware_onprem_database.database_info.container_info
network_name = container_info.network_info.network_name
assert network_name
with ContextDockerClient() as docker_client:
Expand All @@ -17,9 +16,9 @@ def run_localstack(backend_aware_onprem_database) -> tuple[str, str] | None:
image="localstack/localstack",
ports={s3_port: s3_port},
environment={'SERVICES': 's3'},
network=network_name,
network=f'container:{container_info.container_name}',
detach=True)
network_settings = container.attrs['NetworkSettings']['Networks'][network_name]
network_settings = container.attrs['NetworkSettings']
ip_address = network_settings['IPAddress']
assert ip_address, f"Unable to get the IP address from the network settings {network_settings}"
s3_uri = f"https://{ip_address}:{s3_port}"
Expand Down

0 comments on commit 691fc73

Please sign in to comment.