test: drop tests that grep source text instead of behaviour
These asserted on file contents rather than what the code does: Dockerfile strings, deploy.yml YAML, CHANGELOG headings, and greps of main.go for identifiers. Two also referenced config.docker.toml and docker-compose.yml, which were never committed, so they could not pass at all. The worst compared strings.Index byte offsets in main.go to assert startup ordering -- it would pass on code that never runs and fail on a correct refactor that moved a line.
This commit is contained in:
1 parent
4c0a06df6d
commit
bc5d8dcdc9
5 files changed
-282
No files matched your search
@@ -262,31 +262,6 @@ func TestOverlay(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDockerConfigOverlaysExampleConfig(t *testing.T) {
|
||||
cfg, err := loadOverlay(
|
||||
filepath.Join("..", "..", "..", "config.example.toml"),
|
||||
filepath.Join("..", "..", "..", "config.docker.toml"),
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if cfg.Agent.Mode != "nats" {
|
||||
t.Errorf("Agent.Mode: got %q, want %q", cfg.Agent.Mode, "nats")
|
||||
}
|
||||
if cfg.Containers.Image == "" {
|
||||
t.Error("Containers.Image: want docker overlay image, got empty")
|
||||
}
|
||||
// bot_user and repos are not set by the docker overlay -- they must
|
||||
// come from the base config, proving the overlay isn't a standalone
|
||||
// config that silently drops required fields.
|
||||
if cfg.BotUser == "" {
|
||||
t.Error("BotUser: want value from base config.example.toml, got empty")
|
||||
}
|
||||
if len(cfg.Repos) == 0 {
|
||||
t.Error("Repos: want repos from base config.example.toml, got none")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadBytesDoesNotExist(t *testing.T) {
|
||||
_, err := loadBytes(nil)
|
||||
if err == nil {
|
||||
|
||||
Reference in new issue
Block a user