Skip to content

Commit dff8378

Browse files
simskijpiksel
andauthored
Feat/head failure toggle (#928)
* feat: make head pull failure warning toggleable * expect prometheus tests to go through EVENTUALLY * wait for queue to be empty before checking test conditions * clean up new head failure toggle * fixup! clean up new head failure toggle * test: add warn on head failure tests * fix client interface and make tests hit more lines * make all tests use NewClient instead of creating a struct pointer * fix lint issues * see if moving ubuntu out of the matrix solves test issue Co-authored-by: nils måsén <nils@piksel.se>
1 parent 6f281b7 commit dff8378

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/workflows/pull-request.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
go-version:
3434
- 1.15.x
3535
platform:
36-
- ubuntu-latest
3736
- macos-latest
3837
- windows-latest
3938
runs-on: ${{ matrix.platform }}
@@ -53,7 +52,26 @@ jobs:
5352
uses: codecov/codecov-action@v1
5453
with:
5554
token: ${{ secrets.CODECOV_TOKEN }}
56-
55+
test-ubuntu:
56+
name: Test (Ubuntu)
57+
runs-on: ubuntu-latest
58+
needs: test
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v2
62+
with:
63+
fetch-depth: 0
64+
- name: Set up Go
65+
uses: actions/setup-go@v2
66+
with:
67+
go-version: 1.15.x
68+
- name: Run tests
69+
run: |
70+
go test -v -coverprofile coverage.out -covermode atomic ./...
71+
- name: Publish coverage
72+
uses: codecov/codecov-action@v1
73+
with:
74+
token: ${{ secrets.CODECOV_TOKEN }}
5775
build:
5876
name: Build
5977
runs-on: ubuntu-latest

pkg/metrics/metrics.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ func (metrics *Metrics) QueueIsEmpty() bool {
2929
return len(metrics.channel) == 0
3030
}
3131

32+
// QueueIsEmpty checks whether any messages are enqueued in the channel
33+
func (metrics *Metrics) QueueIsEmpty() bool {
34+
return len(metrics.channel) == 0
35+
}
36+
3237
// Register registers metrics for an executed scan
3338
func (metrics *Metrics) Register(metric *Metric) {
3439
metrics.channel <- metric

0 commit comments

Comments
 (0)