Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
service-prober
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
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
Show more breadcrumbs
ai3
tools
service-prober
Commits
46e4397e
Commit
46e4397e
authored
1 year ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Allow HTTP probe steps to have names
To simplify debugging.
parent
6c04a969
No related branches found
No related tags found
No related merge requests found
Pipeline
#57807
failed
1 year ago
Stage: test
Stage: build
Stage: container-test
Stage: release
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
probes/http/http_probe.go
+6
-2
6 additions, 2 deletions
probes/http/http_probe.go
protocol/http/step.go
+1
-0
1 addition, 0 deletions
protocol/http/step.go
with
7 additions
and
2 deletions
probes/http/http_probe.go
+
6
−
2
View file @
46e4397e
...
@@ -53,9 +53,13 @@ type httpProbe struct {
...
@@ -53,9 +53,13 @@ type httpProbe struct {
func
(
p
*
httpProbe
)
RunProbe
(
ctx
context
.
Context
,
debug
*
log
.
Logger
)
error
{
func
(
p
*
httpProbe
)
RunProbe
(
ctx
context
.
Context
,
debug
*
log
.
Logger
)
error
{
browser
:=
http
.
NewBrowser
(
p
.
tls
,
debug
,
p
.
dnsMap
)
browser
:=
http
.
NewBrowser
(
p
.
tls
,
debug
,
p
.
dnsMap
)
for
idx
,
step
:=
range
p
.
script
{
for
idx
,
step
:=
range
p
.
script
{
debug
.
Printf
(
"sequence step #%d"
,
idx
+
1
)
stepName
:=
fmt
.
Sprintf
(
"#%d"
,
idx
+
1
)
if
step
.
Name
!=
""
{
stepName
=
fmt
.
Sprintf
(
"%s - '%s'"
,
stepName
,
step
.
Name
)
}
debug
.
Printf
(
"sequence step %s"
,
stepName
)
if
err
:=
http
.
CheckStep
(
ctx
,
browser
,
step
,
debug
);
err
!=
nil
{
if
err
:=
http
.
CheckStep
(
ctx
,
browser
,
step
,
debug
);
err
!=
nil
{
err
=
fmt
.
Errorf
(
"step
#%d
failed: %w"
,
idx
+
1
,
err
)
err
=
fmt
.
Errorf
(
"step
%s
failed: %w"
,
stepName
,
err
)
debug
.
Printf
(
"%v"
,
err
)
debug
.
Printf
(
"%v"
,
err
)
return
err
return
err
}
}
...
...
This diff is collapsed.
Click to expand it.
protocol/http/step.go
+
1
−
0
View file @
46e4397e
...
@@ -17,6 +17,7 @@ type BasicAuth struct {
...
@@ -17,6 +17,7 @@ type BasicAuth struct {
// A Step in a script, a series of HTTP transactions whose results we can
// A Step in a script, a series of HTTP transactions whose results we can
// verify somehow (right now just by needle-in-haystack string matching).
// verify somehow (right now just by needle-in-haystack string matching).
type
Step
struct
{
type
Step
struct
{
Name
string
`json:"name"`
Type
string
`json:"type"`
Type
string
`json:"type"`
URL
string
`json:"url"`
URL
string
`json:"url"`
Method
string
`json:"method"`
Method
string
`json:"method"`
...
...
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