-
Notifications
You must be signed in to change notification settings - Fork 2k
switch to bats for integration testing #615
Conversation
This looks awesome :) Looking forward to use bats for docker-archive/classicswarm#376 |
} | ||
|
||
@test "cli: show config help" { | ||
run ./docker-machine_$PLATFORM-$ARCH config -h |
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.
Minor nit:
I think you could define a function somewhere, say machine
that does the run with $PLATFORM-$ARCH etc so that you could write instead:
machine config -h
So you won't have to repeat this every time.
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.
+1 thx!
This looks great! I could think of a few places to use it at work :) |
Sweet! Will have to give it a whirl. |
d45d36c
to
e3d0adb
Compare
Signed-off-by: Evan Hazlett <[email protected]>
more flexibility for testing; not all drivers support the same actions Signed-off-by: Evan Hazlett <[email protected]>
…dd container test Signed-off-by: Evan Hazlett <[email protected]>
Signed-off-by: Evan Hazlett <[email protected]>
Signed-off-by: Evan Hazlett <[email protected]>
Signed-off-by: Evan Hazlett <[email protected]>
Signed-off-by: Evan Hazlett <[email protected]>
…n test Signed-off-by: Evan Hazlett <[email protected]>
adef019
to
46d92fc
Compare
@nathanleclaire @sthulb PTAL |
} | ||
|
||
@test "$DRIVER: machine should not exist" { | ||
run machine active $NAME |
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.
Is there a difference between this machine
and where you're using docker-machine_$PLATFORM_$ARCH
?
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.
There is no difference. machine
is simply a function that returns docker-machine_$PLATFORM_$ARCH
LGTM. Can we get the core tests added to travis? |
@sthulb thanks! i'm going to merge for now. i will check on adding the core tests to travis as i'm not sure what the variable exposure is or whether we want to place keys there. thanks! |
switch to bats for integration testing
In docker#615, the helper function `machine()` was created and used within the vmwarefusion test suite (amongst others) to wrap a platform-specfic binary during the test suite. In docker#1034, it appears that this name was changed to the normal docker-machine binary, which can incoke the system-installed one, not the recently compiled one, potentially testing the incorrect binary. See: - docker#615 (comment) - https://github.com/docker/machine/pull/1034/files#diff-62c88a2fede921556dbdeead731596b2R14
In docker#615, the helper function `machine()` was created and used within the vmwarefusion test suite (amongst others) to wrap a platform-specfic binary during the test suite. In docker#1034, it appears that this name was changed to the normal docker-machine binary, which can incoke the system-installed one, not the recently compiled one, potentially testing the incorrect binary. See: - docker#615 (comment) - https://github.com/docker/machine/pull/1034/files#diff-62c88a2fede921556dbdeead731596b2R14 Signed-off-by: Mike Fiedler <[email protected]>
This uses https://github.com/sstephenson/bats for integration testing using the compiled binary. Huge thanks to @aluzzardi for recommending! Details are in the readme. This also removes the old integration tests (they were quirky anyway).
Note: To test a cloud provider, you will need the credentials loaded as environment variables.
You specify a
DRIVER
and bats will run the tests (commands) against that driver: