Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
telegraf-nftables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Show more breadcrumbs
vqgroup
telegraf-nftables
Commits
64a23c0b
Commit
64a23c0b
authored
7 years ago
by
Boris Schrijver
Committed by
Daniel Nelson
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix make test-ci run (#4002)
parent
af68975e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+4
-4
4 additions, 4 deletions
Makefile
plugins/outputs/influxdb/influxdb_test.go
+0
-4
0 additions, 4 deletions
plugins/outputs/influxdb/influxdb_test.go
with
4 additions
and
8 deletions
Makefile
+
4
−
4
View file @
64a23c0b
...
@@ -4,7 +4,7 @@ BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
...
@@ -4,7 +4,7 @@ BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT
:=
$(
shell git rev-parse
--short
HEAD
)
COMMIT
:=
$(
shell git rev-parse
--short
HEAD
)
GOFILES
?=
$(
shell git ls-files
'*.go'
)
GOFILES
?=
$(
shell git ls-files
'*.go'
)
GOFMT
?=
$(
shell gofmt
-l
$(
filter-out plugins/parsers/influx/machine.go,
$(
GOFILES
)))
GOFMT
?=
$(
shell gofmt
-l
$(
filter-out plugins/parsers/influx/machine.go,
$(
GOFILES
)))
BUILDFLAGS
?=
BUILDFLAGS
?=
ifdef
GOBIN
ifdef
GOBIN
PATH
:=
$(
GOBIN
)
:
$(
PATH
)
PATH
:=
$(
GOBIN
)
:
$(
PATH
)
...
@@ -44,7 +44,7 @@ fmt:
...
@@ -44,7 +44,7 @@ fmt:
fmtcheck
:
fmtcheck
:
@
echo
'[INFO] running gofmt to identify incorrectly formatted code...'
@
echo
'[INFO] running gofmt to identify incorrectly formatted code...'
@
if
[
!
-z
$(
GOFMT
)
]
;
then
\
@
if
[
!
-z
"
$(
GOFMT
)
"
]
;
then
\
echo
"[ERROR] gofmt has found errors in the following files:"
;
\
echo
"[ERROR] gofmt has found errors in the following files:"
;
\
echo
"
$(
GOFMT
)
"
;
\
echo
"
$(
GOFMT
)
"
;
\
echo
""
;
\
echo
""
;
\
...
@@ -64,7 +64,7 @@ test-windows:
...
@@ -64,7 +64,7 @@ test-windows:
# any common errors.
# any common errors.
vet
:
vet
:
@
echo
'go vet
$$(
go list ./... | grep -v ./plugins/parsers/influx
)
'
@
echo
'go vet
$$(
go list ./... | grep -v ./plugins/parsers/influx
)
'
@
go vet
$$(
go list ./... |
grep
-v
./plugins/parsers/influx
)
;
if
[
$$
?
-
eq
1
]
;
then
\
@
go vet
$$(
go list ./... |
grep
-v
./plugins/parsers/influx
)
;
if
[
$$
?
-
ne
0
]
;
then
\
echo
""
;
\
echo
""
;
\
echo
"go vet has found suspicious constructs. Please remediate any reported errors"
;
\
echo
"go vet has found suspicious constructs. Please remediate any reported errors"
;
\
echo
"to fix them before submitting code for review."
;
\
echo
"to fix them before submitting code for review."
;
\
...
@@ -72,7 +72,7 @@ vet:
...
@@ -72,7 +72,7 @@ vet:
fi
fi
test-ci
:
fmtcheck vet
test-ci
:
fmtcheck vet
go
test
-short
./...
go
test
-short
./...
test-all
:
fmtcheck vet
test-all
:
fmtcheck vet
go
test
./...
go
test
./...
...
...
This diff is collapsed.
Click to expand it.
plugins/outputs/influxdb/influxdb_test.go
+
0
−
4
View file @
64a23c0b
...
@@ -137,15 +137,12 @@ func TestConnectHTTPConfig(t *testing.T) {
...
@@ -137,15 +137,12 @@ func TestConnectHTTPConfig(t *testing.T) {
}
}
func
TestWriteRecreateDatabaseIfDatabaseNotFound
(
t
*
testing
.
T
)
{
func
TestWriteRecreateDatabaseIfDatabaseNotFound
(
t
*
testing
.
T
)
{
var
createDatabaseCalled
bool
output
:=
influxdb
.
InfluxDB
{
output
:=
influxdb
.
InfluxDB
{
URLs
:
[]
string
{
"http://localhost:8086"
},
URLs
:
[]
string
{
"http://localhost:8086"
},
CreateHTTPClientF
:
func
(
config
*
influxdb
.
HTTPConfig
)
(
influxdb
.
Client
,
error
)
{
CreateHTTPClientF
:
func
(
config
*
influxdb
.
HTTPConfig
)
(
influxdb
.
Client
,
error
)
{
return
&
MockClient
{
return
&
MockClient
{
CreateDatabaseF
:
func
(
ctx
context
.
Context
)
error
{
CreateDatabaseF
:
func
(
ctx
context
.
Context
)
error
{
createDatabaseCalled
=
true
return
nil
return
nil
},
},
WriteF
:
func
(
ctx
context
.
Context
,
metrics
[]
telegraf
.
Metric
)
error
{
WriteF
:
func
(
ctx
context
.
Context
,
metrics
[]
telegraf
.
Metric
)
error
{
...
@@ -178,7 +175,6 @@ func TestWriteRecreateDatabaseIfDatabaseNotFound(t *testing.T) {
...
@@ -178,7 +175,6 @@ func TestWriteRecreateDatabaseIfDatabaseNotFound(t *testing.T) {
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
metrics
:=
[]
telegraf
.
Metric
{
m
}
metrics
:=
[]
telegraf
.
Metric
{
m
}
createDatabaseCalled
=
false
err
=
output
.
Write
(
metrics
)
err
=
output
.
Write
(
metrics
)
// We only have one URL, so we expect an error
// We only have one URL, so we expect an error
require
.
Error
(
t
,
err
)
require
.
Error
(
t
,
err
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment