Skip to content

Commit

Permalink
Add check for "Sources" comment
Browse files Browse the repository at this point in the history
to check that these all generate a line:
- cmdline
- remote config (config_url)
- local files

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
  • Loading branch information
jimmykarily committed Sep 23, 2024
1 parent a18102f commit d725ee9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions collector/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,23 @@ options:
fmt.Print(player)
Expect(player["name"]).NotTo(Equal("Toad"))
Expect(player["surname"]).To(Equal("Bros"))

cs, _ := c.String()
// Check "Sources" comment
Expect(cs).To(MatchRegexp(`.*
# Sources:
# - /tmp/.*/local_config_1.yaml
# - http://127.0.0.1:.*/remote_config_3.yaml
# - http://127.0.0.1:.*/remote_config_4.yaml
# - /tmp/.*/local_config_2.yaml
# - http://127.0.0.1:.*/remote_config_5.yaml
# - http://127.0.0.1:.*/remote_config_6.yaml
# - /tmp/.*/local_config_3.yaml
# - cmdline
# - http://127.0.0.1:.*/remote_config_1.yaml
# - http://127.0.0.1:.*/remote_config_2.yaml
.*
`))
})
})

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ github.com/docker/cli v27.1.1+incompatible h1:goaZxOqs4QKxznZjjBWKONQci/MywhtRv2
github.com/docker/cli v27.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v27.3.0+incompatible h1:BNb1QY6o4JdKpqwi9IB+HUYcRRrVN4aGFUTvDmWYK1A=
github.com/docker/docker v27.3.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI=
github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
Expand Down

0 comments on commit d725ee9

Please sign in to comment.