Skip to content

Commit

Permalink
Remove bats tests, use commander instead
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBaeumer committed Mar 8, 2019
1 parent 900863d commit 0dd3bfb
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 37 deletions.
12 changes: 2 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ env:
- CC_TEST_REPORTER_ID=e0a73033ac8d1dfa04a23fdf69f14e0c6875bf07ab37c83d72ab60bf4913cbcb

stages:
- security
- test
- deploy

go:
- 1.11.x
- 1.12.x

sudo: required
dist: trusty
Expand All @@ -26,11 +25,6 @@ before_install:

jobs:
include:
- stage: security
name: "Security checks"
script: make sec || true
allow_failure: true # Does not work at the moment in travis-ci?

- stage: test
name: "Go lint"
script: make lint
Expand All @@ -52,9 +46,7 @@ jobs:

- name: "dgoss tests"
before_script:
- sudo add-apt-repository ppa:duggan/bats --yes
- sudo apt-get update -qq
- sudo apt-get install -qq bats
- curl -fsSL https://raw.githubusercontent.com/SimonBaeumer/commander/master/install.sh | COMMANDER_DST=~/bin sh
script:
- make build
- make test-dgoss
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test-all: lint test test-int

test-dgoss:
$(info INFO: Starting build $@)
cd extras/dgoss/tests; ./dgoss-test.sh
cd extras/dgoss; commander test

deps:
$(info INFO: Starting build $@)
Expand Down
25 changes: 25 additions & 0 deletions extras/dgoss/commander.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
tests:
run dgoss with mount strategy:
command: "GOSS_PATH=./../../release/goss-linux-amd64 GOSS_FILES_STRATEGY=mount ./dgoss run nginx:latest"
stdout:
contains:
- "Count: 1, Failed: 0, Skipped: 0"
stderr:
lines:
0: "INFO: Starting docker container"
exit-code: 0

run dgoss with cp strategy:
command: "GOSS_PATH=./../../release/goss-linux-amd64 GOSS_FILES_STRATEGY=cp ./dgoss run nginx:latest"
stdout:
contains:
- "Count: 1, Failed: 0, Skipped: 0"
stderr:
lines:
0: "INFO: Creating docker container"
1: "INFO: Copy goss files into container"
exit-code: 0

run dgoss with invalid goss path:
command: "GOSS_PATH=/invalid ./dgoss run nginx:latest"
exit-code: 1
File renamed without changes.
26 changes: 0 additions & 26 deletions extras/dgoss/tests/dgoss-test.sh

This file was deleted.

0 comments on commit 0dd3bfb

Please sign in to comment.