Skip to content

Commit

Permalink
Format go and more robust tests
Browse files Browse the repository at this point in the history
Compose in tests adds suffix to containers
  • Loading branch information
Nekroze committed Nov 3, 2018
1 parent 3d9631d commit 25b9e95
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Are you ready to get STABLE!
- Reversed changelog output, newest changes are at the bottom
- `dab config keys` can now take a config key to limit its output
- Moved some hooks to post execution such as checking wrapper updates
- More robust tests

### Added

Expand Down
2 changes: 1 addition & 1 deletion completion/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ var dab = complete.Command{
},
},
"shell": {}, "sh": {}, "cmd": {},
"tip": {},
"tip": {},
"update": {}, "upgrade": {},
"changelog": {}, "changes": {},
},
Expand Down
6 changes: 4 additions & 2 deletions tests/features/group.feature
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ Feature: Subcommand: dab group
"""
Executing six entrypoint start
"""
And I successfully run `docker top services_redis_1`
And I successfully run `docker ps`
And output should contain "services_redis_1"

Scenario: Can group groups and repos then start them together
Given I successfully run `dab services stop`
Expand All @@ -78,4 +79,5 @@ Feature: Subcommand: dab group
"""
Executing seven entrypoint deploy
"""
And I successfully run `docker top services_redis_1`
And I successfully run `docker ps`
And output should contain "services_redis_1"
18 changes: 9 additions & 9 deletions tests/features/services.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ Feature: Subcommand: dab services
And the output should contain "Building"

Scenario Outline: Can start and stop services
When I run `dab services start <SERVICE>`
When I successfully run `dab services start <SERVICE>`

Then the exit status should be 0
And I successfully run `docker top services_<SERVICE>_1`
Then I successfully run `docker ps`
And output should contain "services_<SERVICE>_1"

When I successfully run `dab services stop <SERVICE>`

Then I run `docker top services_<SERVICE>_1`
And it should fail with "is not running"
Then I successfully run `docker ps`
And output should contain not "services_<SERVICE>_1"

Examples:
| SERVICE |
Expand Down Expand Up @@ -67,13 +67,13 @@ Feature: Subcommand: dab services

When I run `dab services stop`

Then I run `docker top services_redis_1`
And it should fail with "is not running"
Then I successfully run `docker ps`
And output should contain not "services_redis_1"

Scenario: Can erase all services and their state at once
Given I successfully run `dab services start redis`

When I run `dab services destroy`

Then I run `docker top services_redis_1`
And it should fail with "No such container"
Then I successfully run `docker ps`
And output should contain not "services_redis_1"
15 changes: 8 additions & 7 deletions tests/features/tools.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ Feature: Subcommand: dab tools
"""
^<TOOL> is available at https?://localhost:[0-9]+$
"""
And I successfully run `docker top tools_<TOOL>_1`
And I successfully run `docker ps`
And output should contain "tools_<TOOL>_1"

When I successfully run `dab tools stop <TOOL>`

Then I run `docker top tools_<TOOL>_1`
And it should fail with "is not running"
Then I successfully run `docker ps`
And output should contain not "tools_<TOOL>_1"

Examples:
| TOOL |
Expand Down Expand Up @@ -71,14 +72,14 @@ Feature: Subcommand: dab tools

When I run `dab tools stop`

Then I run `docker top tools_cyberchef_1`
And it should fail with "is not running"
Then I successfully run `docker ps`
And output should contain not "tools_cyberchef_1"

Scenario: Can erase all tools and their state at once
Given I successfully run `dab tools start cyberchef`

When I run `dab tools destroy`
And it should pass with "Stopping tools_cyberchef_1 ... done"

Then I run `docker top tools_cyberchef_1`
And it should fail with "No such container"
Then I successfully run `docker ps`
And output should contain not "tools_cyberchef_1"

0 comments on commit 25b9e95

Please sign in to comment.