Skip to content

Conversation

@jirikuncar
Copy link
Contributor

Request body must match recorded one in cassettes.

@jirikuncar jirikuncar requested a review from a team as a code owner July 24, 2020 09:38
@jirikuncar
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented Jul 24, 2020

Codecov Report

Merging #406 into master will decrease coverage by 27.38%.
The diff coverage is n/a.

Impacted Files Coverage Δ
api/v1/datadog/api_hosts.go 0.00% <0.00%> (-72.76%) ⬇️
api/v1/datadog/api_snapshots.go 0.00% <0.00%> (-72.42%) ⬇️
api/v1/datadog/api_tags.go 0.00% <0.00%> (-71.62%) ⬇️
api/v1/datadog/api_events.go 0.00% <0.00%> (-71.29%) ⬇️
api/v1/datadog/model_widget_definition.go 0.00% <0.00%> (-71.02%) ⬇️
api/v1/datadog/api_pager_duty_integration.go 0.00% <0.00%> (-70.98%) ⬇️
api/v1/datadog/api_logs.go 0.00% <0.00%> (-70.00%) ⬇️
api/v1/datadog/api_organizations.go 0.00% <0.00%> (-70.00%) ⬇️
api/v2/datadog/api_dashboard_lists.go 0.00% <0.00%> (-69.69%) ⬇️
api/v1/datadog/api_logs_pipelines.go 0.00% <0.00%> (-69.69%) ⬇️
... and 426 more

@jirikuncar jirikuncar added changelog/no-changelog Changes don't appear in changelog dev/testing Tests related changes labels Jul 24, 2020
Comment on lines 355 to 358
if strings.HasPrefix(r.Header["Content-Type"][0], "multipart/form-data") {
fmt.Printf("skip %s ??? %s", b.String(), i.Body)
return true
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a hot fix for multipart/form-data that are not exactly the same for some reason even when the content is the same.

fmt.Printf("skip %s ??? %s", b.String(), i.Body)
return true
}
matched := (b.String() == "" || b.String() == i.Body)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it a match if the body is empty and different than the recorded body ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's related to GET requests that do not contain body.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But shouldn't it be equal to the recorded body i.Body anyway ?

@jirikuncar jirikuncar requested review from bkabrda and zippolyte July 27, 2020 09:29
@jirikuncar
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jirikuncar jirikuncar merged commit 557240b into master Jul 27, 2020
@jirikuncar jirikuncar deleted the jirikuncar/match-body branch July 27, 2020 14:00
sfluor pushed a commit that referenced this pull request Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog Changes don't appear in changelog dev/testing Tests related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants