Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more features to test IPFIX collector web API #351

Merged

Conversation

antoninbas
Copy link
Member

When querying records, one can now specify the max number of flows that should be returned (starting with the most recent one), as well as the format of the response (json or text).

We also add a size limit for the flowRecords slice, to avoid unbounded memory usage.

When querying records, one can now specify the max number of flows that
should be returned (starting with the most recent one), as well as the
format of the response (json or text).

We also add a size limit for the flowRecords slice, to avoid unbounded
memory usage.

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
cmd/collector/collector.go Show resolved Hide resolved
cmd/collector/collector_test.go Outdated Show resolved Hide resolved
cmd/collector/collector_test.go Outdated Show resolved Hide resolved
require.NoError(t, err)

if expectedStatus != http.StatusOK {
return
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this return will ignore the last 3 tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, that's correct, good catch
I forgot to call t.Run to define the subtests

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
Copy link
Contributor

@yuntanghsu yuntanghsu left a comment

Choose a reason for hiding this comment

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

LGTM

@antoninbas antoninbas merged commit 621ab6a into vmware:main Jun 3, 2024
7 checks passed
@antoninbas antoninbas deleted the add-more-features-to-test-collector-api branch June 3, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants