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

feat: add the parse_raw_upload function #59

Closed
wants to merge 6 commits into from

Conversation

joseph-sentry
Copy link
Contributor

@joseph-sentry joseph-sentry commented Dec 13, 2024

this commit adds the parse_raw_upload function which
takes the entire raw test results upload in bytes and returns
the output as a messagepacked payload

this is to reduce the overhead of calling into the rust library then
returning the result back to python

so we will use serde to deserialize the raw upload first, then iterate
through each file in the upload and base64 decode its data and
decompress it. from that point onwards it's basically the same as
before: we have a JUnit XML in the form of a vector of bytes

instead of returning a list of ParsingInfo objects we are now
serializing the resulting list of ParsingInfo into the messagepack
format since we will be storing that in redis intermediately anyways

@joseph-sentry joseph-sentry marked this pull request as draft December 13, 2024 19:57
@codecov-notifications
Copy link

codecov-notifications bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 94.76440% with 10 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/raw_upload.rs 89.28% 6 Missing ⚠️
src/testrun.rs 80.00% 2 Missing ⚠️
src/compute_name.rs 98.93% 1 Missing ⚠️
src/junit.rs 96.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 94.76440% with 10 lines in your changes missing coverage. Please review.

Project coverage is 89.26%. Comparing base (d9346a6) to head (1117e75).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/raw_upload.rs 89.28% 6 Missing ⚠️
src/testrun.rs 80.00% 2 Missing ⚠️
src/compute_name.rs 98.93% 1 Missing ⚠️
src/junit.rs 96.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
+ Coverage   85.34%   89.26%   +3.91%     
==========================================
  Files           5        6       +1     
  Lines         587      764     +177     
==========================================
+ Hits          501      682     +181     
+ Misses         86       82       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joseph-sentry joseph-sentry marked this pull request as ready for review December 16, 2024 20:10
@joseph-sentry joseph-sentry force-pushed the joseph/parse-raw-upload branch from 6cc5e88 to 90be9f3 Compare December 19, 2024 20:10
@joseph-sentry joseph-sentry changed the title feat: parse_junit_xml becomes parse_raw_upload feat: add the parse_raw_upload function Dec 19, 2024
we want to handle when the skip or error is an empty XML element

we also want to handle when the error has a message in the same way that
a failure has a message
- this covers the case where a user will upload their test results file
  for pytest without -o junit_family=legacy, but with their network set
- this is the network that is usually uploaded from the CLI
- the network is optional argument and defaults to None
- since it's usually a list of file paths that contain the paths to
  source files we can use it to deduce the path associated with a pytest
  test result if the filename has not been provided
- this commit also moves the tests from python to rust and removes the
  python interface for the compute_name function since it's no longer
  needed
- there's possibly future work that can be done to optimize this process
  of matching the test result classname to files in the network, but
  this is a minimal working solution, it's also possible that with the
  updated instructions in the docs
we will need to handle msgpacking, base64 decoding and zlib
decompressing
we want to document the new function that we're going to implement
we want to support parsing raw upload files instead of individual JUnit
XML files

the input of this new function is the raw upload in byte form

the output is a messagepacked binary payload containing the results of
the parsing and the raw upload in readable format in byte form
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.

1 participant