Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-12-05 18:58:55 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-12-05 18:58:55 +0300
commitaf3eeb3bf82c49bfe3b0371b5fb8aaf1ad9ff1b2 (patch)
tree69ea60b060697da2e68c286ffec31f05e6abc66b /internal/source/gitlab/cache/cache_test.go
parentbc54e819aa4285084698d5713170266699d4d4ed (diff)
Simplify gitlab source client by not recording http status
Diffstat (limited to 'internal/source/gitlab/cache/cache_test.go')
-rw-r--r--internal/source/gitlab/cache/cache_test.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/internal/source/gitlab/cache/cache_test.go b/internal/source/gitlab/cache/cache_test.go
index f140c479..cd6e6f06 100644
--- a/internal/source/gitlab/cache/cache_test.go
+++ b/internal/source/gitlab/cache/cache_test.go
@@ -19,7 +19,6 @@ type client struct {
bootup chan uint64
domain chan string
failure error
- status int
}
func (c *client) GetLookup(ctx context.Context, _ string) api.Lookup {
@@ -28,10 +27,6 @@ func (c *client) GetLookup(ctx context.Context, _ string) api.Lookup {
c.bootup <- atomic.AddUint64(&c.started, 1)
defer atomic.AddUint64(&c.resolutions, 1)
- if c.status == 0 {
- lookup.Status = 200
- }
-
if c.failure == nil {
lookup.Name = <-c.domain
} else {
@@ -71,7 +66,7 @@ func (cache *Cache) withTestEntry(config entryConfig, block func(*Entry)) {
entry := cache.store.LoadOrCreate(domain)
if config.retrieved {
- entry.setResponse(api.Lookup{Name: domain, Status: 200})
+ entry.setResponse(api.Lookup{Name: domain})
}
if config.expired {
@@ -100,7 +95,6 @@ func TestResolve(t *testing.T) {
lookup := cache.Resolve(context.Background(), "my.gitlab.com")
assert.NoError(t, lookup.Error)
- assert.Equal(t, 200, lookup.Status)
assert.Equal(t, "my.gitlab.com", lookup.Name)
assert.Equal(t, uint64(1), resolver.resolutions)
})