From: Ben Kochie Date: Fri, 4 Dec 2020 10:36:48 +0000 (+0100) Subject: Update build X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=da0b223d7a477ba6388d55266017aeab7415f495;p=blackbox_exporter.git Update build * Move make test from Travis to CircleCI. * Drop Travis testing. * Bump prometheus orb to latest. * Update Makefile.common. * Use default build target list. * Switch CI prober tests env var to generic "CI" variable. Signed-off-by: Ben Kochie --- diff --git a/.circleci/config.yml b/.circleci/config.yml index e21b05c..d488027 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,12 +2,28 @@ version: 2.1 orbs: - prometheus: prometheus/prometheus@0.1.0 + prometheus: prometheus/prometheus@0.8.0 + +executors: + # Whenever the Go version is updated here, .promu.yml should also be updated. + golang: + docker: + - image: circleci/golang:1.15 jobs: + test: + executor: golang + + steps: + - prometheus/setup_environment + - run: make + - prometheus/store_artifact: + file: blackbox_exporter + - run: git diff --exit-code + # IPv6 tests require the machine executor. # See https://circleci.com/docs/2.0/faq/#can-i-use-ipv6-in-my-tests for details. - test: + test-ipv6: machine: true working_directory: /home/circleci/.go_workspace/src/github.com/prometheus/blackbox_exporter # Whenever the Go version is updated here, .travis.yml and .promu.yml @@ -37,6 +53,10 @@ workflows: filters: tags: only: /.*/ + - test-ipv6: + filters: + tags: + only: /.*/ - prometheus/build: name: build filters: @@ -46,6 +66,7 @@ workflows: context: org-context requires: - test + - test-ipv6 - build filters: branches: @@ -54,6 +75,7 @@ workflows: context: org-context requires: - test + - test-ipv6 - build filters: tags: diff --git a/.promu.yml b/.promu.yml index 396c1a3..b2f5795 100644 --- a/.promu.yml +++ b/.promu.yml @@ -17,28 +17,3 @@ tarball: - blackbox.yml - LICENSE - NOTICE -crossbuild: - platforms: - - linux/amd64 - - linux/386 - - darwin/amd64 - - windows/amd64 - - windows/386 - - freebsd/amd64 - - freebsd/386 - - openbsd/amd64 - - openbsd/386 - - netbsd/amd64 - - netbsd/386 - - dragonfly/amd64 - - linux/arm - - linux/arm64 - - freebsd/arm - - openbsd/arm - - linux/mips64 - - linux/mips64le - # Temporarily deactivated as golang.org/x/sys does not have syscalls - # implemented for that os/platform combination. - #- netbsd/arm - - linux/ppc64 - - linux/ppc64le diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c5d12c4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -sudo: false - -language: go - -# Whenever the Go version is updated here, .circleci/config.yml and .promu.yml -# should also be updated. -go: -- 1.15.x - -go_import_path: github.com/prometheus/blackbox_exporter - -script: -- make -- git diff --exit-code diff --git a/Makefile.common b/Makefile.common index 9320176..3ac29c6 100644 --- a/Makefile.common +++ b/Makefile.common @@ -78,7 +78,7 @@ ifneq ($(shell which gotestsum),) endif endif -PROMU_VERSION ?= 0.5.0 +PROMU_VERSION ?= 0.7.0 PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz GOLANGCI_LINT := @@ -245,10 +245,12 @@ common-docker-publish: $(PUBLISH_DOCKER_ARCHS) $(PUBLISH_DOCKER_ARCHS): common-docker-publish-%: docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" +DOCKER_MAJOR_VERSION_TAG = $(firstword $(subst ., ,$(shell cat VERSION))) .PHONY: common-docker-tag-latest $(TAG_DOCKER_ARCHS) common-docker-tag-latest: $(TAG_DOCKER_ARCHS) $(TAG_DOCKER_ARCHS): common-docker-tag-latest-%: docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest" + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)" .PHONY: common-docker-manifest common-docker-manifest: diff --git a/prober/dns_test.go b/prober/dns_test.go index ef2d2b0..6e0d861 100644 --- a/prober/dns_test.go +++ b/prober/dns_test.go @@ -86,8 +86,8 @@ func recursiveDNSHandler(w dns.ResponseWriter, r *dns.Msg) { } func TestRecursiveDNSResponse(t *testing.T) { - if os.Getenv("TRAVIS") == "true" { - t.Skip("skipping; travisci is failing on ipv6 dns requests") + if os.Getenv("CI") == "true" { + t.Skip("skipping; CI is failing on ipv6 dns requests") } tests := []struct { @@ -226,8 +226,8 @@ func authoritativeDNSHandler(w dns.ResponseWriter, r *dns.Msg) { } func TestAuthoritativeDNSResponse(t *testing.T) { - if os.Getenv("TRAVIS") == "true" { - t.Skip("skipping; travisci is failing on ipv6 dns requests") + if os.Getenv("CI") == "true" { + t.Skip("skipping; CI is failing on ipv6 dns requests") } tests := []struct { @@ -376,8 +376,8 @@ func TestAuthoritativeDNSResponse(t *testing.T) { } func TestServfailDNSResponse(t *testing.T) { - if os.Getenv("TRAVIS") == "true" { - t.Skip("skipping; travisci is failing on ipv6 dns requests") + if os.Getenv("CI") == "true" { + t.Skip("skipping; CI is failing on ipv6 dns requests") } tests := []struct { @@ -446,6 +446,10 @@ func TestServfailDNSResponse(t *testing.T) { } func TestDNSProtocol(t *testing.T) { + if os.Getenv("CI") == "true" { + t.Skip("skipping; CI is failing on ipv6 dns requests") + } + // This test assumes that listening TCP listens both IPv6 and IPv4 traffic and // localhost resolves to both 127.0.0.1 and ::1. we must skip the test if either // of these isn't true. This should be true for modern Linux systems. diff --git a/prober/tcp_test.go b/prober/tcp_test.go index 6b4fdb3..753fc89 100644 --- a/prober/tcp_test.go +++ b/prober/tcp_test.go @@ -73,8 +73,8 @@ func TestTCPConnectionFails(t *testing.T) { } func TestTCPConnectionWithTLS(t *testing.T) { - if os.Getenv("TRAVIS") == "true" { - t.Skip("skipping; travisci is failing on ipv6 dns requests") + if os.Getenv("CI") == "true" { + t.Skip("skipping; CI is failing on ipv6 dns requests") } ln, err := net.Listen("tcp", ":0") @@ -203,8 +203,8 @@ func TestTCPConnectionWithTLS(t *testing.T) { } func TestTCPConnectionWithTLSAndVerifiedCertificateChain(t *testing.T) { - if os.Getenv("TRAVIS") == "true" { - t.Skip("skipping; travisci is failing on ipv6 dns requests") + if os.Getenv("CI") == "true" { + t.Skip("skipping; CI is failing on ipv6 dns requests") } ln, err := net.Listen("tcp", "127.0.0.1:0") @@ -565,6 +565,10 @@ func TestTCPConnectionQueryResponseMatching(t *testing.T) { } func TestTCPConnectionProtocol(t *testing.T) { + if os.Getenv("CI") == "true" { + t.Skip("skipping; CI is failing on ipv6 dns requests") + } + // This test assumes that listening TCP listens both IPv6 and IPv4 traffic and // localhost resolves to both 127.0.0.1 and ::1. we must skip the test if either // of these isn't true. This should be true for modern Linux systems.