From ad5d74d5a1b2826f53bab2af979a09817358c93e Mon Sep 17 00:00:00 2001 From: Cosmin Cojocar Date: Mon, 3 Jan 2022 18:11:35 +0100 Subject: [PATCH] Update to ginkgo v2 (#753) --- Makefile | 6 +++--- analyzer_test.go | 2 +- call_list_test.go | 2 +- cmd/gosec/sort_issues_test.go | 2 +- cmd/tlsconfig/tls_version_go12_go13.go | 1 + config_test.go | 2 +- cwe/cwe_suite_test.go | 2 +- cwe/data_test.go | 2 +- cwe/types_test.go | 2 +- flag_test.go | 2 +- go.mod | 2 +- go.sum | 7 +++++-- gosec_suite_test.go | 2 +- helpers_test.go | 2 +- import_tracker_test.go | 2 +- issue_test.go | 2 +- report/formatter_suite_test.go | 2 +- report/formatter_test.go | 2 +- report/sarif/sarif_suite_test.go | 2 +- report/sarif/sarif_test.go | 2 +- report/sonar/sonar_suite_test.go | 2 +- report/sonar/sonar_test.go | 2 +- resolve_test.go | 2 +- rule_test.go | 2 +- rules/rules_suite_test.go | 2 +- rules/rules_test.go | 2 +- 26 files changed, 32 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index e28818c..567dcbc 100644 --- a/Makefile +++ b/Makefile @@ -12,18 +12,18 @@ GOBIN ?= $(GOPATH)/bin GOLINT ?= $(GOBIN)/golint GOSEC ?= $(GOBIN)/gosec GINKGO ?= $(GOBIN)/ginkgo -GO_VERSION = 1.15 +GO_VERSION = 1.17 default: $(MAKE) build install-test-deps: - $(GO_NOMOD) get -u github.com/onsi/ginkgo/ginkgo + go install github.com/onsi/ginkgo/v2/ginkgo@latest $(GO_NOMOD) get -u golang.org/x/crypto/ssh $(GO_NOMOD) get -u github.com/lib/pq test: install-test-deps build fmt lint sec - $(GINKGO) -r -v + $(GINKGO) -v --fail-fast fmt: @echo "FORMATTING" diff --git a/analyzer_test.go b/analyzer_test.go index c6f1cd7..fdb51bd 100644 --- a/analyzer_test.go +++ b/analyzer_test.go @@ -7,7 +7,7 @@ import ( "os" "strings" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" "github.com/securego/gosec/v2/rules" diff --git a/call_list_test.go b/call_list_test.go index 6400234..6373dd9 100644 --- a/call_list_test.go +++ b/call_list_test.go @@ -3,7 +3,7 @@ package gosec_test import ( "go/ast" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" "github.com/securego/gosec/v2/testutils" diff --git a/cmd/gosec/sort_issues_test.go b/cmd/gosec/sort_issues_test.go index d98c71d..e92efe9 100644 --- a/cmd/gosec/sort_issues_test.go +++ b/cmd/gosec/sort_issues_test.go @@ -3,7 +3,7 @@ package main import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" ) diff --git a/cmd/tlsconfig/tls_version_go12_go13.go b/cmd/tlsconfig/tls_version_go12_go13.go index ae29178..005d53a 100644 --- a/cmd/tlsconfig/tls_version_go12_go13.go +++ b/cmd/tlsconfig/tls_version_go12_go13.go @@ -1,3 +1,4 @@ +//go:build go1.12 && !go1.14 // +build go1.12,!go1.14 // This file can be removed once go1.13 is no longer supported diff --git a/config_test.go b/config_test.go index 1a470b5..3d49111 100644 --- a/config_test.go +++ b/config_test.go @@ -4,7 +4,7 @@ import ( "bytes" "strings" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" ) diff --git a/cwe/cwe_suite_test.go b/cwe/cwe_suite_test.go index fd5bcf6..df90478 100644 --- a/cwe/cwe_suite_test.go +++ b/cwe/cwe_suite_test.go @@ -3,7 +3,7 @@ package cwe_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/cwe/data_test.go b/cwe/data_test.go index 453a2af..b77bf3a 100644 --- a/cwe/data_test.go +++ b/cwe/data_test.go @@ -1,7 +1,7 @@ package cwe_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2/cwe" ) diff --git a/cwe/types_test.go b/cwe/types_test.go index d16993a..6fde26c 100644 --- a/cwe/types_test.go +++ b/cwe/types_test.go @@ -1,7 +1,7 @@ package cwe_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2/cwe" ) diff --git a/flag_test.go b/flag_test.go index c0d95b0..c3bc7a6 100644 --- a/flag_test.go +++ b/flag_test.go @@ -4,7 +4,7 @@ import ( "flag" "os" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2/cmd/vflag" ) diff --git a/go.mod b/go.mod index a5efe76..9efc1f0 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/lib/pq v1.10.4 github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5 github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 - github.com/onsi/ginkgo v1.16.5 + github.com/onsi/ginkgo/v2 v2.0.0 github.com/onsi/gomega v1.17.0 golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 diff --git a/go.sum b/go.sum index ed2d98e..3178da2 100644 --- a/go.sum +++ b/go.sum @@ -157,6 +157,7 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -187,6 +188,7 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -264,9 +266,10 @@ github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2f github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= diff --git a/gosec_suite_test.go b/gosec_suite_test.go index 891c207..e63a63d 100644 --- a/gosec_suite_test.go +++ b/gosec_suite_test.go @@ -3,7 +3,7 @@ package gosec_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/helpers_test.go b/helpers_test.go index a4d484b..bdf07b5 100644 --- a/helpers_test.go +++ b/helpers_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "regexp" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" "github.com/securego/gosec/v2/testutils" diff --git a/import_tracker_test.go b/import_tracker_test.go index a631ab8..b060b34 100644 --- a/import_tracker_test.go +++ b/import_tracker_test.go @@ -1,7 +1,7 @@ package gosec_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" "github.com/securego/gosec/v2/testutils" diff --git a/issue_test.go b/issue_test.go index eeedefb..eae7715 100644 --- a/issue_test.go +++ b/issue_test.go @@ -3,7 +3,7 @@ package gosec_test import ( "go/ast" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" "github.com/securego/gosec/v2/rules" diff --git a/report/formatter_suite_test.go b/report/formatter_suite_test.go index 063bd7a..a7a9ba4 100644 --- a/report/formatter_suite_test.go +++ b/report/formatter_suite_test.go @@ -3,7 +3,7 @@ package report import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/report/formatter_test.go b/report/formatter_test.go index 3fed7f2..94a2505 100644 --- a/report/formatter_test.go +++ b/report/formatter_test.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" "github.com/securego/gosec/v2/cwe" diff --git a/report/sarif/sarif_suite_test.go b/report/sarif/sarif_suite_test.go index 6b198be..2dc885d 100644 --- a/report/sarif/sarif_suite_test.go +++ b/report/sarif/sarif_suite_test.go @@ -3,7 +3,7 @@ package sarif_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/report/sarif/sarif_test.go b/report/sarif/sarif_test.go index ed35d49..54c8a57 100644 --- a/report/sarif/sarif_test.go +++ b/report/sarif/sarif_test.go @@ -4,7 +4,7 @@ import ( "bytes" "regexp" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" "github.com/securego/gosec/v2/report/sarif" diff --git a/report/sonar/sonar_suite_test.go b/report/sonar/sonar_suite_test.go index c8eb3d7..d505cec 100644 --- a/report/sonar/sonar_suite_test.go +++ b/report/sonar/sonar_suite_test.go @@ -3,7 +3,7 @@ package sonar_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/report/sonar/sonar_test.go b/report/sonar/sonar_test.go index 122d63c..9afdbf5 100644 --- a/report/sonar/sonar_test.go +++ b/report/sonar/sonar_test.go @@ -1,7 +1,7 @@ package sonar_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" "github.com/securego/gosec/v2/report/sonar" diff --git a/resolve_test.go b/resolve_test.go index d1d0c98..f4c872d 100644 --- a/resolve_test.go +++ b/resolve_test.go @@ -3,7 +3,7 @@ package gosec_test import ( "go/ast" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" "github.com/securego/gosec/v2/testutils" diff --git a/rule_test.go b/rule_test.go index c5ce61a..e800986 100644 --- a/rule_test.go +++ b/rule_test.go @@ -4,7 +4,7 @@ import ( "fmt" "go/ast" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" ) diff --git a/rules/rules_suite_test.go b/rules/rules_suite_test.go index 73cd9cf..8bc8baa 100644 --- a/rules/rules_suite_test.go +++ b/rules/rules_suite_test.go @@ -3,7 +3,7 @@ package rules_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/rules/rules_test.go b/rules/rules_test.go index 9117911..19890cf 100644 --- a/rules/rules_test.go +++ b/rules/rules_test.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/securego/gosec/v2" "github.com/securego/gosec/v2/rules"