-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: SSAPI Unit Tests (BPS-272) #1982
Conversation
require.False(t, done) | ||
} | ||
|
||
func TestInitCheckpoint(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these supposed to be implemented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow those changes didn't get added in my last commit. Should be good now.
Type string `xml:"type,attr"` | ||
Dict Dict `xml:"dict"` | ||
} `xml:"content"` | ||
type SearchStatusResponse struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type SearchStatusResponse struct { | |
type SearchJobStatusResponse struct { |
nit: I think this is more indicative of a name. not required just something I think makes it more readable
} | ||
|
||
// Content struct to represent <content> elements | ||
type Content struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type Content struct { | |
type SearchJobContent struct { |
Along similar veins
</s:key> | ||
</s:dict> | ||
</content> | ||
</entry> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</entry> | |
</entry> | |
nit
@@ -11,6 +11,7 @@ require ( | |||
go.opentelemetry.io/collector/extension/experimental/storage v0.113.0 | |||
go.opentelemetry.io/collector/pdata v1.19.0 | |||
go.opentelemetry.io/collector/receiver v0.113.0 | |||
go.opentelemetry.io/collector/receiver/receivertest v0.113.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this not rmake any go.sum changes? I'd imagine it would. Would you mind re-running go mod tidy
to just double check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently not 🤷♂️
) | ||
|
||
var ( | ||
server = newMockServer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit I think I'd like to see these defined within the test functions themselves so other test files can use the names server
and testClient
without worrying about variable shadowing.
<s:key name="cursorTime">1969-12-31T16:00:00.000-08:00</s:key> | ||
<s:key name="delegate"></s:key> | ||
<s:key name="diskUsage">2174976</s:key> | ||
<s:key name="dispatchState">DONE</s:key> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having a dispatchState as not done will be another important test for any future changes.
@@ -60,6 +61,10 @@ func newSplunkSearchAPIClient(ctx context.Context, settings component.TelemetryS | |||
func (c defaultSplunkSearchAPIClient) CreateSearchJob(search string) (CreateJobResponse, error) { | |||
endpoint := fmt.Sprintf("%s/services/search/jobs", c.endpoint) | |||
|
|||
if !strings.Contains(search, "starttime=") || !strings.Contains(search, "endtime=") || !strings.Contains(search, "timeformat=") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be overkill but in splunk, are these case-insensitive? I.e. I believe you can do Starttime="<whatever>
and its still valid
For the sake of correctness I'm curious if we need to make these error checks non case-sensitive?
I know that we're inputting these parameters so its not too big of a deal, so maybe a comment would suffice in this situation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I didn't know that about Splunk.
Proposed Change
Add more unit tests for the Splunk Search API Receiver.
Checklist