Allow getJSON errors to be ignored

This change is mostly motivated to get a more stable CI build (we're building the Hugo site there, with Instagram and Twitter shortcodes sometimes failing).

Fixes #7866
This commit is contained in:
Bjørn Erik Pedersen
2020-10-21 11:17:48 +02:00
parent 8cbe2bbfad
commit fdfa4a5fe6
52 changed files with 318 additions and 221 deletions

View File

@@ -108,14 +108,14 @@ func TestGetCSV(t *testing.T) {
got, err := ns.GetCSV(test.sep, test.url)
if _, ok := test.expect.(bool); ok {
c.Assert(int(ns.deps.Log.ErrorCounter.Count()), qt.Equals, 1)
c.Assert(int(ns.deps.Log.LogCounters().ErrorCounter.Count()), qt.Equals, 1)
//c.Assert(err, msg, qt.Not(qt.IsNil))
c.Assert(got, qt.IsNil)
continue
}
c.Assert(err, qt.IsNil, msg)
c.Assert(int(ns.deps.Log.ErrorCounter.Count()), qt.Equals, 0)
c.Assert(int(ns.deps.Log.LogCounters().ErrorCounter.Count()), qt.Equals, 0)
c.Assert(got, qt.Not(qt.IsNil), msg)
c.Assert(got, qt.DeepEquals, test.expect, msg)
@@ -198,12 +198,12 @@ func TestGetJSON(t *testing.T) {
got, _ := ns.GetJSON(test.url)
if _, ok := test.expect.(bool); ok {
c.Assert(int(ns.deps.Log.ErrorCounter.Count()), qt.Equals, 1)
c.Assert(int(ns.deps.Log.LogCounters().ErrorCounter.Count()), qt.Equals, 1)
//c.Assert(err, msg, qt.Not(qt.IsNil))
continue
}
c.Assert(int(ns.deps.Log.ErrorCounter.Count()), qt.Equals, 0, msg)
c.Assert(int(ns.deps.Log.LogCounters().ErrorCounter.Count()), qt.Equals, 0, msg)
c.Assert(got, qt.Not(qt.IsNil), msg)
c.Assert(got, qt.DeepEquals, test.expect)
}