Skip to content

Commit

Permalink
feat(ssh): support SSH-based command execution (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhijeetSaroha authored Nov 4, 2024
1 parent 4363190 commit dd0b2fd
Show file tree
Hide file tree
Showing 10 changed files with 422 additions and 8 deletions.
30 changes: 30 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{py,rst,ini}]
indent_style = space
indent_size = 4

[*.{html,css,scss,json,yml,xml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[default.conf]
indent_style = space
indent_size = 2

["Makefile"]
indent_style = tab

[*.{diff,patch}]
trim_trailing_whitespace = false
16 changes: 16 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ jobs:
- name: Run unit tests
run: makim tests.unittest

- name: Run smoke test for interactive args
run: makim smoke-tests.interactive-args

- name: Run smoke test for hooks (pre and post)
run: makim smoke-tests.run-hooks

- name: Run smoke test for matrix combinations
run: makim smoke-tests.matrix

- name: Run smoke test for shell app
run: makim smoke-tests.shell-app

- name: Run smoke test for ssh remote execution
if: ${{ matrix.os != 'macos' }}
run: makim smoke-tests.ssh-remote-execution

- name: Semantic Release PR Title Check
uses: osl-incubator/[email protected]
if: success() || failure()
Expand Down
21 changes: 19 additions & 2 deletions .makim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ groups:
- task: smoke-tests.interactive-args
- task: smoke-tests.run-hooks
- task: smoke-tests.matrix
- task: makim smoke-tests.shell-app
- task: smoke-tests.shell-app
- task: smoke-tests.ssh-remote-execution

ci:
help: Run all tasks used on CI
Expand Down Expand Up @@ -413,6 +414,22 @@ groups:
makim $VERBOSE_FLAG --file $MAKIM_FILE test.browser
makim $VERBOSE_FLAG --file $MAKIM_FILE test.browser --headless
ssh-remote-execution:
help: Test makim with remote execution
args:
verbose-mode:
help: Run the all the tests in verbose mode
type: bool
action: store_true
env:
MAKIM_FILE: tests/smoke/.makim-ssh.yaml
backend: bash
run: |
export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}'
makim $VERBOSE_FLAG --file $MAKIM_FILE --help
makim $VERBOSE_FLAG --file $MAKIM_FILE --version
makim $VERBOSE_FLAG --file $MAKIM_FILE remote_test.echo_test
error:
help: This group helps tests failure tasks
tasks:
Expand Down Expand Up @@ -458,4 +475,4 @@ groups:
run: |
# it requires the password manually
ssh-keygen -R "[localhost]:2222" || true
ssh -o StrictHostKeyChecking=no testuser@localhost -p 2222
ssh -o StrictHostKeyChecking=no testuser@localhost -p 2222 'pwd'
152 changes: 151 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ python-levenshtein = ">=0.23.0"
rich = ">=10.11.0"
shellingham = ">=1.5.4"
jsonschema = ">=4"
paramiko = "^3.5.0"

[tool.poetry.group.dev.dependencies]
containers-sugar = ">=1.11.1"
Expand All @@ -60,6 +61,7 @@ jupyterlab = ">=4.1.5"
nox = ">=2024.3.2"
nbconvert = ">=7.16.3"
pymdown-extensions = ">=10.7.1"
types-paramiko = "^3.5.0.20240928"

[build-system]
requires = ["poetry-core>=1.0.0", "poetry>=1.5.1"]
Expand Down Expand Up @@ -118,7 +120,7 @@ quote-style = "single"
[tool.bandit]
exclude_dirs = ["tests"]
targets = "src/makim/"
skips = ["B102", "B701"]
skips = ["B102", "B701", "B507", "B601"]

[tool.vulture]
exclude = ["tests"]
Expand Down
Loading

0 comments on commit dd0b2fd

Please sign in to comment.