Pull request: all: imp errcheck in tests
Merge in DNS/adguard-home from imp-errcheck to master Squashed commit of the following: commit ed046b8ef59a092a27c623cd14b3fc2ef305fc3d Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Feb 4 15:00:04 2021 +0300 stats: imp cleanup more commit e53a9240d3e3eec2417c768b98c267a8cd54d992 Merge: da734317676f8c76Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Feb 4 14:59:40 2021 +0300 Merge branch 'master' into imp-errcheck commit da734317035543b52e5a9030813084bdc92ba90a Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Feb 4 14:37:26 2021 +0300 stats: imp cleanup commit 8b4ad150129111a09be6fa2944a21bd06ab8e5a1 Merge: 385c8a6c5081ead0Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Feb 4 14:34:26 2021 +0300 Merge branch 'master' into imp-errcheck commit 385c8a6c91e3bf07a457da370c8cc77820b91600 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Jan 29 20:41:57 2021 +0300 all: imp errcheck in tests
This commit is contained in:
@@ -34,6 +34,10 @@ func TestStats(t *testing.T) {
|
||||
Filename: "./stats.db",
|
||||
LimitDays: 1,
|
||||
}
|
||||
t.Cleanup(func() {
|
||||
assert.Nil(t, os.Remove(conf.Filename))
|
||||
})
|
||||
|
||||
s, _ := createObject(conf)
|
||||
|
||||
e := Entry{}
|
||||
@@ -86,7 +90,6 @@ func TestStats(t *testing.T) {
|
||||
|
||||
s.clear()
|
||||
s.Close()
|
||||
os.Remove(conf.Filename)
|
||||
}
|
||||
|
||||
func TestLargeNumbers(t *testing.T) {
|
||||
@@ -102,7 +105,10 @@ func TestLargeNumbers(t *testing.T) {
|
||||
LimitDays: 1,
|
||||
UnitID: newID,
|
||||
}
|
||||
os.Remove(conf.Filename)
|
||||
t.Cleanup(func() {
|
||||
assert.Nil(t, os.Remove(conf.Filename))
|
||||
})
|
||||
|
||||
s, _ := createObject(conf)
|
||||
e := Entry{}
|
||||
|
||||
@@ -128,7 +134,6 @@ func TestLargeNumbers(t *testing.T) {
|
||||
assert.EqualValues(t, int(hour)*n, d.NumDNSQueries)
|
||||
|
||||
s.Close()
|
||||
os.Remove(conf.Filename)
|
||||
}
|
||||
|
||||
// this code is a chunk copied from getData() that generates aggregate data per day
|
||||
|
||||
Reference in New Issue
Block a user