Skip to content

Commit 576ff62

Browse files
committed
Introduce skip mechanism
Signed-off-by: Ulysses Souza <[email protected]>
1 parent 0265267 commit 576ff62

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

commands/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "docker-compose v1"
1+
name: "docker-composeV1"
22
command: "docker-compose"
33
global_opts:
44
- name: "-f"

compliance_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const (
1919
func TestSimpleLifecycle(t *testing.T) {
2020
h := TestHelper{T: t, testDir: "simple_lifecycle"}
2121
h.testUpDown(func(t *testing.T) {
22-
time.Sleep(time.Second) // FIXME Test when the up is complete here
22+
time.Sleep(time.Second)
2323
})
2424
}
2525

@@ -63,9 +63,12 @@ func TestSecretFile(t *testing.T) {
6363
})
6464
}
6565

66-
// Ignored because docker-compose does not support that for now
67-
func _TestConfigFile(t *testing.T) {
68-
h := TestHelper{T: t, testDir: "simple_configfile"}
66+
func TestConfigFile(t *testing.T) {
67+
h := TestHelper{
68+
T: t,
69+
testDir: "simple_configfile",
70+
skipCommands: []string{"docker-composeV1"},
71+
}
6972
h.testUpDown(func(t *testing.T) {
7073
actual := getHttpBody(t, volumeUrl+"test_config.txt")
7174
assert.Assert(t, actual == "{\"response\":\"MYCONFIG\"}\n")

tests_helper.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ func getHttpBody(t *testing.T, address string) string {
130130

131131
type TestHelper struct {
132132
*testing.T
133-
testDir string
133+
testDir string
134+
skipCommands []string
134135
}
135136

136137
func (h TestHelper) testUpDown(fun func(t *testing.T)) {
@@ -139,6 +140,11 @@ func (h TestHelper) testUpDown(fun func(t *testing.T)) {
139140
h.Run(f, func(t *testing.T) {
140141
c, err := readConfig(t, filepath.Join(commandsDir, f))
141142
assert.NilError(t, err)
143+
for _, v := range h.skipCommands {
144+
if v == c.Name {
145+
t.SkipNow()
146+
}
147+
}
142148
executeUp(t, c, h.testDir)
143149
fun(t)
144150
executeDown(t, c, h.testDir)

0 commit comments

Comments
 (0)