Skip to content

Add new test_sample_rate_function#1476

Merged
LotharSee merged 1 commit intomainfrom
benjamin/add-test_sample_rate_function
Aug 23, 2023
Merged

Add new test_sample_rate_function#1476
LotharSee merged 1 commit intomainfrom
benjamin/add-test_sample_rate_function

Conversation

@LotharSee
Copy link
Copy Markdown
Contributor

@LotharSee LotharSee commented Aug 8, 2023

Description

Add a new test test_sample_rate_function which checks that weblog takes the exact same sampling decision as the one precomputed in an auxiliary .csv file.

This test is broader and stricter than the previous tests test_sampling_decision, test_sampling_decision_added and test_sampling_decision_added (if any of them fail, the new one would fail too). In a later PR, I'll propose to consolidate it all.

Motivation

The purpose of this approach is to use a portable language agnostic set of (trace_id, sampling_rate, sampling_decision) to test the implementation of the sampling function. The given CSV can be copied to be sure in libraries' unit tests. I plan on using it on to test our backend implementation too.
The CSV is meant to include cases for "tricky" values (ex: small, large, at the edge of 2^63) which would who typically fail if the function were badly implemented (ex: offset by one, doing a 2^63 modulo instead of 2^64).

Workflow

  1. ⚠️⚠️ Create your PR as draft
  2. Follow the style guidelines of this project (See how to easily lint the code)
  3. Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
  4. Mark it as ready for review

Once your PR is reviewed, you can merge it! ❤️

Reviewer checklist

  • Check what scenarios are modified. If needed, add the relevant label (run-parametric-scenario, run-profiling-scenario...). If this PR modifies any system-tests internal, then add the run-all-scenarios label (more info).
  • CI is green
    • If not, failing jobs are not related to this change (and you are 100% sure about this statement)
  • if any of build-some-image label is present
    1. is the image labl have been updated ?
    2. just before merging, locally build and push the image to hub.docker.com
  • if a scenario is added (or removed), add (or remove) it in system-test-dasboard nightly

@LotharSee LotharSee mentioned this pull request Aug 16, 2023
5 tasks
@LotharSee LotharSee force-pushed the benjamin/cleanup-sampling-tests branch from 5a46076 to ac1d56e Compare August 16, 2023 16:16
Base automatically changed from benjamin/cleanup-sampling-tests to main August 18, 2023 11:47
@LotharSee LotharSee force-pushed the benjamin/add-test_sample_rate_function branch 3 times, most recently from 2880947 to b44d739 Compare August 18, 2023 14:21
@LotharSee LotharSee force-pushed the benjamin/add-test_sample_rate_function branch 8 times, most recently from 18cdd6d to e9843eb Compare August 18, 2023 18:26
@LotharSee LotharSee marked this pull request as ready for review August 18, 2023 19:30
@LotharSee LotharSee requested a review from a team as a code owner August 18, 2023 19:30
Comment thread tests/test_sampling_rates.py Outdated
@LotharSee LotharSee force-pushed the benjamin/add-test_sample_rate_function branch from e9843eb to 1bd195e Compare August 21, 2023 12:58
@LotharSee LotharSee merged commit 6247a5d into main Aug 23, 2023
@LotharSee LotharSee deleted the benjamin/add-test_sample_rate_function branch August 23, 2023 09:11
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