Skip to content

Commit

Permalink
Add more coverage for air check unchanged file (#290)
Browse files Browse the repository at this point in the history
* add test case for filechecksum
  • Loading branch information
xiantang authored Jun 5, 2022
1 parent 1d4d116 commit 7b308c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions runner/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,10 @@ func NewEngine(cfgPath string, debugMode bool) (*Engine, error) {
canExit: make(chan bool, 1),
binStopCh: make(chan bool),
exitCh: make(chan bool),
fileChecksums: &checksumMap{m: make(map[string]string)},
watchers: 0,
}

if cfg.Build.ExcludeUnchanged {
e.fileChecksums = &checksumMap{m: make(map[string]string)}
}

return &e, nil
}

Expand Down
1 change: 1 addition & 0 deletions runner/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func TestRebuild(t *testing.T) {
t.Fatalf("Should not be fail: %s.", err)
}
engine, err := NewEngine("", true)
engine.config.Build.ExcludeUnchanged = true
if err != nil {
t.Fatalf("Should not be fail: %s.", err)
}
Expand Down

0 comments on commit 7b308c5

Please sign in to comment.