-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from algorandfoundation/goal-shell
feat(goal): Added algokit goal --console / algokit sandbox console
- Loading branch information
Showing
8 changed files
with
131 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DEBUG: Running 'docker version' in '{current_working_directory}' | ||
DEBUG: docker: STDOUT | ||
DEBUG: docker: STDERR | ||
Opening Bash console on the algod node; execute `exit` to return to original console | ||
DEBUG: Running 'docker exec -it -w /root algokit_algod bash' in '{current_working_directory}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DEBUG: Running 'docker version' in '{current_working_directory}' | ||
DEBUG: docker: STDOUT | ||
DEBUG: docker: STDERR | ||
Opening Bash console on the algod node; execute `exit` to return to original console | ||
DEBUG: Running 'docker exec -it -w /root algokit_algod bash' in '{current_working_directory}' | ||
Error: Error executing goal; ensure the Sandbox is started by executing `algokit sandbox status` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from subprocess import CompletedProcess | ||
|
||
from approvaltests import verify # type: ignore | ||
from pytest_mock import MockerFixture | ||
from utils.click_invoker import invoke | ||
from utils.exec_mock import ExecMock | ||
|
||
|
||
def test_goal_console(exec_mock: ExecMock, mocker: MockerFixture): | ||
mocker.patch("algokit.core.exec.subprocess_run").return_value = CompletedProcess( | ||
["docker", "exec"], 0, "STDOUT+STDERR" | ||
) | ||
|
||
result = invoke("sandbox console") | ||
|
||
assert result.exit_code == 0 | ||
verify(result.output) |
10 changes: 10 additions & 0 deletions
10
tests/sandbox/test_sandbox_console.test_goal_console.approved.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' | ||
DEBUG: docker: {"version": "v2.5.0"} | ||
DEBUG: Running 'docker version' in '{current_working_directory}' | ||
DEBUG: docker: STDOUT | ||
DEBUG: docker: STDERR | ||
DEBUG: Running 'docker version' in '{current_working_directory}' | ||
DEBUG: docker: STDOUT | ||
DEBUG: docker: STDERR | ||
Opening Bash console on the algod node; execute `exit` to return to original console | ||
DEBUG: Running 'docker exec -it -w /root algokit_algod bash' in '{current_working_directory}' |