Update build
authorBen Kochie <superq@gmail.com>
Fri, 4 Dec 2020 10:36:48 +0000 (11:36 +0100)
committerBen Kochie <superq@gmail.com>
Tue, 8 Dec 2020 14:25:24 +0000 (15:25 +0100)
* 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 <superq@gmail.com>
.circleci/config.yml
.promu.yml
.travis.yml [deleted file]
Makefile.common
prober/dns_test.go
prober/tcp_test.go

index e21b05c1629744d95245759eafe162c3749f00a3..d4880270e3e7bb63732612a3f553414d0c2bfed2 100644 (file)
@@ -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:
index 396c1a31a4e7158130e02a687f3976aa2a5e2b2b..b2f5795b82f21bc00f45b4b4adef44f4b923f192 100644 (file)
@@ -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 (file)
index c5d12c4..0000000
+++ /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
index 9320176ca24f423b5e90adb69df97c6829495c7d..3ac29c636c6b85418945a08f49b2d92233390b5b 100644 (file)
@@ -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:
index ef2d2b0cbcc63c88f28382457dafcbda3bf1d9d6..6e0d861730f29e6a621e877bad65bb4ce0c3afce 100644 (file)
@@ -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.
index 6b4fdb3673cdbf088770b2dfb53cd88aa130ca8d..753fc896a51b9e7d0257549d23f9f3d0667a1f5e 100644 (file)
@@ -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.