-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cli tests - synchronous testing of platform commands #522
Conversation
ac3735a
to
a2f64a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are failing -
=== RUN TestCliCmds
--- FAIL: TestCliCmds (18.26s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x80d3e]
goroutine 5 [running]:
panic(0x18dd40, 0xc42000e060)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
testing.tRunner.func1(0xc420086180)
/usr/local/go/src/testing/testing.go:579 +0x25d
panic(0x18dd40, 0xc42000e060)
/usr/local/go/src/runtime/panic.go:458 +0x243
github.com/appcelerator/amp/tests/cli.runCmdSpec(0xc420086180, 0x1, 0xc4200b6080, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/nviswanathan/dev/src/github.com/appcelerator/amp/tests/cli/cli_test.go:207 +0x95e
github.com/appcelerator/amp/tests/cli.runFrameworkSpec(0xc420086180, 0xc420014960)
/Users/nviswanathan/dev/src/github.com/appcelerator/amp/tests/cli/cli_test.go:136 +0x172
github.com/appcelerator/amp/tests/cli.runFramework(0xc420086180, 0xc420028098, 0x1, 0x1)
/Users/nviswanathan/dev/src/github.com/appcelerator/amp/tests/cli/cli_test.go:114 +0x4e
github.com/appcelerator/amp/tests/cli.TestCliCmds(0xc420086180)
/Users/nviswanathan/dev/src/github.com/appcelerator/amp/tests/cli/cli_test.go:90 +0x571
testing.tRunner(0xc420086180, 0x1d0158)
/usr/local/go/src/testing/testing.go:610 +0x81
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:646 +0x2ec
exit status 2
FAIL github.com/appcelerator/amp/tests/cli 18.274s
Yeah unfortunately, tests are also failing for me:
|
Also, and maybe I'm a bit harsh, but I don't really think we need these tests because Travis already pull and start the platform. |
1cb7832
to
ba8fe2d
Compare
I've made a minor change. The tests were failing due to I like your idea @bquenin . Adding the I still think the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change request on test description format
@@ -1,4 +1,5 @@ | |||
- logs-all: | |||
run: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a default value for run (true)? this way we only have to specify this key when we want to disable a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ndegory changed to a skip
field, so the default value is false and you can give true to skip said command
@JosephGJ Do you want me to remove the amp pf start and stop tests and only keep the amp pf statu test in the cli tests ? |
* fix to minor error
ba8fe2d
to
d7ffabc
Compare
d7ffabc
to
e9b27d3
Compare
@bquenin I've removed the amp pf start and stop commands, as well as any other unnecessary command tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested on linux
Adds tests for the amp platform commands:
(Monitor can't be tested as it does not return to the cli)
Tests are implemented in the setup and tearDown directory
platform.yml
files. The setup and tearDown YAML test specs are run synchronously to the samples, with setup being before and tearDown being after. In addition, the docker swarm is initialized in the setup and left in the tearDown.New field added to the YAML file - run. Boolean which says if a command should or should not be run. By default, the commands in setup and tearDown are not run because they can take upwards of 5 minutes to run.
To test, change the run fields to true in the
platform.yml
in both setup and tearDown directories. Ensure your platform is stopped and rundocker swarm leave --force
(Or you can reset the docker client), then run:go test ./tests/cli