mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-22 05:40:50 +02:00
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>
This commit is contained in:
parent
6f281b727a
commit
dff8378778
2 changed files with 25 additions and 2 deletions
22
.github/workflows/pull-request.yml
vendored
22
.github/workflows/pull-request.yml
vendored
|
@ -33,7 +33,6 @@ jobs:
|
||||||
go-version:
|
go-version:
|
||||||
- 1.15.x
|
- 1.15.x
|
||||||
platform:
|
platform:
|
||||||
- ubuntu-latest
|
|
||||||
- macos-latest
|
- macos-latest
|
||||||
- windows-latest
|
- windows-latest
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
|
@ -53,7 +52,26 @@ jobs:
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
test-ubuntu:
|
||||||
|
name: Test (Ubuntu)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.15.x
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
go test -v -coverprofile coverage.out -covermode atomic ./...
|
||||||
|
- name: Publish coverage
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -29,6 +29,11 @@ func (metrics *Metrics) QueueIsEmpty() bool {
|
||||||
return len(metrics.channel) == 0
|
return len(metrics.channel) == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QueueIsEmpty checks whether any messages are enqueued in the channel
|
||||||
|
func (metrics *Metrics) QueueIsEmpty() bool {
|
||||||
|
return len(metrics.channel) == 0
|
||||||
|
}
|
||||||
|
|
||||||
// Register registers metrics for an executed scan
|
// Register registers metrics for an executed scan
|
||||||
func (metrics *Metrics) Register(metric *Metric) {
|
func (metrics *Metrics) Register(metric *Metric) {
|
||||||
metrics.channel <- metric
|
metrics.channel <- metric
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue