-
Notifications
You must be signed in to change notification settings - Fork 39
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
Core: Snapshot Testing for Output of Observe Session #2139
Open
AmmarAbouZor
wants to merge
11
commits into
esrlabs:master
Choose a base branch
from
AmmarAbouZor:snapshot_testing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AmmarAbouZor
force-pushed
the
snapshot_testing
branch
2 times, most recently
from
October 29, 2024 16:18
dff17fb
to
7144009
Compare
* Create test modules and their helper modules * Implement function to run session and return the created temporary session file * Add pretty assertion to be used to compare session files.
* Create a struct to represent and load the temp output files generated by an observe session, with serialization functions to be used in snapshot testing. * Ensure the generated session files are removed after running the test * Renaming & Refactoring
* Add the crate `insta` for snapshot testing * Integrate insta functions with DLT function to create a snapshot test * Small refactoring & Add newly created files to gitignore
* Rename tests directory & Adjust snapshots accordingly. * Apply clippy tests
* Add support for snapshot testing via command line argument to accept the changes in snapshots * Default test will set environment variables to prevent snapshot testing from creating new snapshot files. * Use trim_end() when printing the logs instead of trim() to avoid trimming suffixes of log lines * Increment tool version & Update change log.
* Add needed environment variable to CI pipeline for snapshot tests. * Replace unwrap() calls with more context. * Add Documentation in code. * Fix typos.
* Fix case when `tmp` directory needs to be created before creating `.chipmunk` in home directory * This case could occur rarely like in integration tests.
* Avoid false positives on detecting changes due to changing in orders on attachments. * TODO to remove cleaning up temporary files manually when cleanup improvements are merged.
AmmarAbouZor
force-pushed
the
snapshot_testing
branch
from
October 31, 2024 07:55
7144009
to
0906beb
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides new tests for the process of reading from binary files (DLT, Pcapng, Pcap legacy), then parsing with (DLT, SomeIP, DLT and SomeIP) parsers, then writing the output to Chipmunk temporary directory. By reading those temp files and having a snapshot for them as a reference to compare to of future changes.
insta
crate) because it's clear to when diffing the snapshotscargo insta
provides more benefits with colored diffs and reviewing each item snapshot at once.insta
crate.tmp
directory in case.chipmunk
directory doesn't exist has been added.