Skip to content

[BenchSpy] add tiny test start/end time validation #1549

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

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

Tofel
Copy link
Contributor

@Tofel Tofel commented Jan 13, 2025


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes introduced in both basic.go and basic_test.go are designed to enhance validation logic for test data configurations in the benchmarking spy utility. By ensuring start and end times are logical and minimum test duration criteria are met, these amendments aim to prevent erroneous data collection and analysis.

What

  • wasp/benchspy/basic.go
    • Added validation to check if test end time is before test start time. This ensures the logical sequence of test timings.
    • Added validation to ensure the test duration is at least one second. This prevents creating tests with durations too short to be meaningful.
  • wasp/benchspy/basic_test.go
    • Introduced test cases for new validation rules:
      • Checking when test start and end times are the same, expecting an error regarding test duration.
      • Verifying behavior when test end time is set before start time, expecting an error about invalid time sequence.
      • Testing with test end time less than a second apart from start time, expecting a validation error about insufficient test duration.

@cl-sonarqube-production
Copy link

@Tofel Tofel marked this pull request as ready for review January 13, 2025 10:37
@Tofel Tofel requested review from sebawo and a team as code owners January 13, 2025 10:37
@Tofel Tofel merged commit 3833744 into main Jan 13, 2025
55 of 56 checks passed
@Tofel Tofel deleted the validate_start_end_time branch January 13, 2025 12:02
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.

2 participants