commander-cli / commander Goto Github PK
View Code? Open in Web Editor NEWTest your command line interfaces on windows, linux and osx and nodes viá ssh and docker
License: MIT License
Test your command line interfaces on windows, linux and osx and nodes viá ssh and docker
License: MIT License
it is a mess :(
It would be nice if I could define a test which will be executed on a different host via ssh
.
--filter="should execute command"
--filter="command*" # With wild card pattern
--filter-node="ssh-host"
--filter-node="ssh*"
Maybe with regex
support?
It would be nice to print better diffs between the expected and actual result
It would be nice to define a timeout for each test / executed command
I want to add a sleep
or interval
if a test fails with retries
.
I.e.
tests:
echo hello:
config:
retries: 4
interval: 10s
It would be nice if parsing timeouts could add untis like this 20ms
.
See time.ParseDuration
When using the automatic adding of tests, manually added tests validation is removed.
commander add --file tests/commander.yaml ./setup-update-tag.sh
diff --git a/tests/commander.yaml b/tests/commander.yaml
)Expected behavior: commander add
should just add new tests, not modify existing ones (resorting the file may be fine)
Actual behavior: It restructures the file and drops test cases. Basically removing most manually made edits.
diff --git a/tests/commander.yaml b/tests/commander.yaml
index 3156fb7..15b5d6c 100755
--- a/tests/commander.yaml
+++ b/tests/commander.yaml
@@ -1,33 +1,18 @@
tests:
- setup with existing .env:
- command: ./setup.sh
+ ./setup-update-tag.sh:
exit-code: 1
- stdout: |-
- Creating individual env files for containers (if they do not exist already)
- .env already exists with initial configuration
- If you want to change the configuration, please edit .env directly
+ stdout: Please install reg in order to run this script.
./version.sh:
exit-code: 0
./version.sh core:
exit-code: 0
- stdout:
- not-contains:
- - core-
- - Debian
- - amd64
- - tar.gz
./version.sh webapp:
exit-code: 0
- stdout:
- not-contains:
- - webapp-
- - Debian
- - amd64
- - tar.gz
./version.sh zpush:
exit-code: 0
- stdout:
- not-contains:
- - Debian
- - amd64
- - tar.gz
+ setup with existing .env:
+ exit-code: 1
+ stdout: |-
+ Creating individual env files for containers (if they do not exist already)
+ .env already exists with initial configuration
+ If you want to change the configuration, please edit .env directly
You can get the version information from executing commander --version
.
It would be nice to have a command
which exposes commander as a healthcheck
Add a field which defines on which os
a test can be executed, i.e.:
tests:
echo hello:
os:
- darwin
- linux
or maybe this is even better:
config:
os: linux # Define default os
tests:
print hello:
cmd:
osx: echo hello osx
windows: echo hello windows
linux: echo hello linux
I would like to add a tap
like output
At the moment it is needed to remove colored output from the shell with something like this:
echo command | sed -r "s/\x1B[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"
it would be nice if tests could be executed against a complete directory of files
Our CLI app makes calls to the shell for other apps, namely docker. During the install step for our cli, it uses docker to pull and configure some containers. If I run install
from the shell, it works. If I run install
from commander test
it fails saying that docker is not found. I had expected config: env: PATH_FROM_SHELL: ${PATH}
to fix this, but there is something more going on that I don't understand.
How does each runner use a shell?
Is is an untestable scenario in commander to test a cli application that uses an OS process to call another cli application?
tests:
titan install:
exit-code: 0
stdout:
contains:
- Titan cli successfully installed, happy data versioning :)
config:
env:
PATH_FROM_SHELL: ${PATH}
timeout: 600s
Expected behavior:
install
should finish and exit process with 0
Actual behavior:
Test fails with Docker not found
install.sh
script which can be fetched via curlIt would be nice to define dependencies on tests. This is necessary especially if I want to test kubernetes resouces.
It should also be possible to activate an interactive mode for debugging purposes.
Example:
it should deploy:
command: ...
it should be available:
command: ...
depends: it should deploy
i was a little bit lazy :(
It would be nice to test interactive commands, but not necessary at the moment
Following the instructions in the README to setup a testing environment with github actions and running commander
does not have any output. I've tried a few variations of invoking commander, but all with the same results. The file will download, I can see it with ls
, but running /commander --version
has no output. I have tried adding it to the path (can confirm it's in the path), but running commander --version
has the same results.
Add a github action with the following config:
https://github.com/mcred/titan/blob/feature/e2e/.github/workflows/test.yml
Inspect output:
https://github.com/mcred/titan/commit/ee26a202ea5218314315bbb387705e97161abc17/checks?check_suite_id=268546125
Expected behavior:
Commander version v1.2.1
Actual behavior: [What actually happened]
No output, failure or exceptions.
It would be nice to execute tests sequentially.
Maybe it would be nice to define an order.
i.e.
stdout:
json:
metadata.name: wordpress
Stdout
and Stderr
The version option output does not contain version numbers.
Install using go command according to https://github.com/SimonBaeumer/commander#installation :
go get github.com/SimonBaeumer/commander/cmd/commander
On terminal, run:
commander -v
Expected behavior:
Output:
Commander version 0.3.0
Actual behavior:
Output:
Commander version
You can get the version information from executing
commander --version
.
No. Whether commander -v
or commander --version
, version number is still missing.
It should be possible to define setup
and tear_down
commands
$ commander -v
Commander version v1.1.0
When running programs that are configurable through environment variables (for example inside of a container) running them through commander fails, since previously set variables are not present.
$ commander add --stdout --no-file env
tests:
env:
exit-code: 0
stdout: PWD=/home/user/current-dir
env
directly in the shellcommander
Expected behavior: commander has access to the environment of the shell it is executed in.
Actual behavior: no environment is preserved.
You can get the version information from executing commander --version
.
It would be cool to execute a test in the shell commander would use
It would be nice to fetch test suites from remote locations like gist.github, http, https etc
Further addin stdin support
config
key in the testsIt would be nice to use cobra as the cli framework in v2.0.0
At the moment it will only be displayed which root attribute failed the test, i.e.:
Starting test file test.yml...
✗ echo hello
Results
✗ echo hello, on property 'Stdout'
--- Got
+++ Expected
@@ -1 +1 @@
-hello
+fail
Duration: 0.003s
Count: 1, Failed: 1
It is not possible to see in the results which attribute of Stdout
failed.
It would be nice to get a log of the output for executed tests
If a new test is added by the add
command the suite will be reordered alphabetically.
It should be possible to create tests by giving the command and automatically create the expectations
$ ./commander add echo hello world
echo hello world:
stdout:
exactly: hello-world
exit-code: 0
It is a mess :(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.