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

Actually add logs fixture sorting #581

Merged
merged 2 commits into from Feb 3, 2023

Conversation

damemi
Copy link
Member

@damemi damemi commented Feb 3, 2023

#580 didn't work because I was just checking the request.LogName field, which our exporter doesn't set (we set individual entry log names ie, request.Entries[i].LogName). I also forgot to add the matching sort to the fixture generator.

The tests still passed due to the randomness of the fixture ordering (until post-merge https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/actions/runs/4086503881). But, I should have caught this based on the fact that fixtures weren't updated in #580.

This sorts each entry in each request, then sorts the requests based on either their LogName or the LogName of the first entry in the request. This should be sufficiently deterministic for our tests.

@damemi damemi requested a review from dashpole February 3, 2023 18:08
@damemi
Copy link
Member Author

damemi commented Feb 3, 2023

failing even harder now, lol. looking into this

@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Merging #581 (6c300a5) into main (11e5b93) will increase coverage by 0.29%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##             main     #581      +/-   ##
==========================================
+ Coverage   63.95%   64.25%   +0.29%     
==========================================
  Files          38       38              
  Lines        4334     4345      +11     
==========================================
+ Hits         2772     2792      +20     
+ Misses       1445     1435      -10     
- Partials      117      118       +1     
Impacted Files Coverage Δ
...er/collector/integrationtest/testcases/testcase.go 82.50% <75.00%> (-0.37%) ⬇️
...lector/internal/datapointstorage/datapointcache.go 89.39% <0.00%> (+9.09%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@damemi
Copy link
Member Author

damemi commented Feb 3, 2023

comparing just by entry.LogName didn't always produce the same output either (for the record, these passed locally for me but failed in the CI environment)

I went all out and just compared the String() output of the protobuf message in each entry. that generated even more fixture changes, and it looks like it passed both locally and in CI now.

@damemi damemi merged commit 0c7cfa7 into GoogleCloudPlatform:main Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants