Skip to content

Commit

Permalink
Improve readability of main countme scenario
Browse files Browse the repository at this point in the history
Shuffle some steps around, add blank lines and also emphasize that we're
dealing with *calendar* weeks/months (i.e. aligned with the calendar,
not with the first countme hit).

No functional change.
  • Loading branch information
dmnks committed May 9, 2024
1 parent c29806e commit 96e9567
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions dnf-behave-tests/dnf/countme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,49 +40,55 @@ Feature: Better user counting
| header | value |
| User-Agent | Agent 007 |

Scenario: Countme flag is sent once per week
Scenario: Countme flag is sent once per calendar week
Given I set config option "countme" to "1"
And today is Wednesday, August 07, 2019
And I copy repository "dnf-ci-fedora" for modification
And I use repository "dnf-ci-fedora" as http
And I set up metalink for repository "dnf-ci-fedora"
And I start capturing outbound HTTP requests
# First week (bucket 1)

# First calendar week (bucket 1)
# Note: One in the first 4 requests is randomly chosen to include the
# flag (see COUNTME_BUDGET=4 in libdnf/repo/Repo.cpp for details)
When today is Wednesday, August 07, 2019
When I execute dnf with args "makecache" 4 times
Then exactly one HTTP GET request should match:
| path |
| */metalink.xml*&countme=1 |
# Same week (should not be sent)

# Same calendar week (should not be sent)
When today is Friday, August 09, 2019
And I forget any HTTP requests captured so far
And I execute dnf with args "makecache" 4 times
Then no HTTP GET request should match:
| path |
| */metalink.xml*&countme=* |
# Next week (bucket 1)

# Next calendar week (bucket 1)
When today is Tuesday, August 13, 2019
And I forget any HTTP requests captured so far
And I execute dnf with args "makecache" 4 times
Then exactly one HTTP GET request should match:
| path |
| */metalink.xml*&countme=1 |
# Next week (bucket 2)

# Next calendar week (bucket 2)
When today is Tuesday, August 21, 2019
And I forget any HTTP requests captured so far
And I execute dnf with args "makecache" 4 times
Then exactly one HTTP GET request should match:
| path |
| */metalink.xml*&countme=2 |
# 1 month later (bucket 3)

# 1 calendar month later (bucket 3)
When today is Tuesday, September 16, 2019
And I forget any HTTP requests captured so far
And I execute dnf with args "makecache" 4 times
Then exactly one HTTP GET request should match:
| path |
| */metalink.xml*&countme=3 |
# 6 months later (bucket 4)

# 6 calendar months later (bucket 4)
When today is Tuesday, March 15, 2020
And I forget any HTTP requests captured so far
And I execute dnf with args "makecache" 4 times
Expand Down

0 comments on commit 96e9567

Please sign in to comment.