Print JSON format and allow disabling tests skipping#10
Open
akarasik wants to merge 10 commits into12932:masterfrom
Open
Print JSON format and allow disabling tests skipping#10akarasik wants to merge 10 commits into12932:masterfrom
akarasik wants to merge 10 commits into12932:masterfrom
Conversation
Recently the Server-Timing header value changed to:
cfRequestDuration;dur=74.000120, cfL4;desc="?proto=TCP,{rest_of_description_here}"
Therefore the split(';') will result in the following string:
dur=74.000120, cfL4
When executing the next float(part.split('=')[1]) it will return
"74.000120, cfL4" which cannot be transformed to a float.
This commit will try to extract it that way (in case the headers will
change back), and if not - it will extract assuming the new format
BUGFIX: Update the duration extraction from the Server-Timing header
- Remove all_test.py and distribute its tests across new test files - Add integration_test.py for end-to-end testing - Implement unit tests for network operations, CLI options, and utility functions - Enhance main function testing with various arguments - Add tests for proxy functionality and CSV output - Improve test coverage for edge cases in percentile calculation - Set up test fixtures for mocking time and requests session - Update requirements-dev.txt to include pytest This commit significantly improves the test suite by breaking down monolithic tests into more focused, modular test files. It adds both unit and integration tests, covering various aspects of the cf_speedtest package including network operations, command-line options, utility functions, and main program flow. The new tests also cover edge cases and different configurations, enhancing the overall robustness of the test suite.
Refactor tests and improve test coverage
In order to get a persistent output that can be used programmaticaly this commit adds 2 new abilities: 1. Print output in JSON format to be able to parse it 2. Allow disabling the tests skipping. This will allow running all of the tests regardless of the patience attribute, which will result in a consistent output each time
Contributor
Author
|
tox is failing, working on resolving this |
Contributor
Author
|
Fixed the tests 😄 |
This file contains hidden or 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
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.
In order to get a persistent output that can be used programmaticaly
this commit adds 2 new abilities:
the tests regardless of the patience attribute, which will result in
a consistent output each time
Here are examples after this change: