Skip to content

Commit

Permalink
feat(localnet): Changing the default reset behaviour to not pull images
Browse files Browse the repository at this point in the history
  • Loading branch information
robdmoore committed Mar 28, 2023
1 parent 8ef890c commit 6d3f10e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ algokit localnet reset [OPTIONS]


### --update, --no-update
Enable or disable updating to the latest available LocalNet version
Enable or disable updating to the latest available LocalNet version, default: don’t update

### start

Expand Down
4 changes: 2 additions & 2 deletions src/algokit/cli/localnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def stop_localnet() -> None:
@localnet_group.command("reset", short_help="Reset the AlgoKit LocalNet.")
@click.option(
"--update/--no-update",
default=True,
help="Enable or disable updating to the latest available LocalNet version",
default=False,
help="Enable or disable updating to the latest available LocalNet version, default: don't update",
)
def reset_localnet(*, update: bool) -> None:
sandbox = ComposeSandbox()
Expand Down
4 changes: 2 additions & 2 deletions tests/localnet/test_localnet_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def test_localnet_reset_with_existing_sandbox_with_up_to_date_config(app_dir_moc


@pytest.mark.usefixtures("proc_mock")
def test_localnet_reset_with_existing_sandbox_with_up_to_date_config_no_pull(app_dir_mock: AppDirs) -> None:
def test_localnet_reset_with_existing_sandbox_with_up_to_date_config_with_pull(app_dir_mock: AppDirs) -> None:
(app_dir_mock.app_config_dir / "sandbox").mkdir()
(app_dir_mock.app_config_dir / "sandbox" / "docker-compose.yml").write_text(get_docker_compose_yml())

result = invoke("localnet reset --no-update")
result = invoke("localnet reset --update")

assert result.exit_code == 0
verify(result.output.replace(str(app_dir_mock.app_config_dir), "{app_config}").replace("\\", "/"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ DEBUG: Running 'docker compose down' in '{app_config}/sandbox'
DEBUG: docker: STDOUT
DEBUG: docker: STDERR
Sandbox definition is out of date; updating it to latest
Looking for latest Sandbox images from DockerHub...
DEBUG: Running 'docker compose pull --ignore-pull-failures --quiet' in '{app_config}/sandbox'
docker: STDOUT
docker: STDERR
Starting AlgoKit LocalNet now...
DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox'
docker: STDOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ Deleting any existing LocalNet...
DEBUG: Running 'docker compose down' in '{app_config}/sandbox'
DEBUG: docker: STDOUT
DEBUG: docker: STDERR
Looking for latest Sandbox images from DockerHub...
DEBUG: Running 'docker compose pull --ignore-pull-failures --quiet' in '{app_config}/sandbox'
docker: STDOUT
docker: STDERR
Starting AlgoKit LocalNet now...
DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox'
docker: STDOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Deleting any existing LocalNet...
DEBUG: Running 'docker compose down' in '{app_config}/sandbox'
DEBUG: docker: STDOUT
DEBUG: docker: STDERR
Looking for latest Sandbox images from DockerHub...
DEBUG: Running 'docker compose pull --ignore-pull-failures --quiet' in '{app_config}/sandbox'
docker: STDOUT
docker: STDERR
Starting AlgoKit LocalNet now...
DEBUG: Running 'docker compose up --detach --quiet-pull --wait' in '{app_config}/sandbox'
docker: STDOUT
Expand Down

0 comments on commit 6d3f10e

Please sign in to comment.