Skip to content

fix(feature_flags): make test conditions deterministic #2059

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
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/utilities/feature_flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,10 @@ def test_flags_condition_match(mocker):
expected_value = True
mocked_app_config_schema = {
"my_feature": {
"default": expected_value,
"default": False,
"rules": {
"tenant id equals 12345": {
"when_match": True,
"when_match": expected_value,
"conditions": [
{
"action": RuleAction.EQUALS.value,
Expand Down
28 changes: 14 additions & 14 deletions tests/functional/feature_flags/test_feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,10 +808,10 @@ def test_flags_not_equal_match(mocker, config):
expected_value = True
mocked_app_config_schema = {
"my_feature": {
"default": expected_value,
"default": False,
"rules": {
"tenant id not equals 345345435": {
"when_match": True,
"when_match": expected_value,
"conditions": [
{
"action": RuleAction.NOT_EQUALS.value,
Expand Down Expand Up @@ -889,10 +889,10 @@ def test_flags_less_than_match(mocker, config):
expected_value = True
mocked_app_config_schema = {
"my_feature": {
"default": expected_value,
"default": False,
"rules": {
"Date less than 2021.10.31": {
"when_match": True,
"when_match": expected_value,
"conditions": [
{
"action": RuleAction.KEY_LESS_THAN_VALUE.value,
Expand Down Expand Up @@ -946,10 +946,10 @@ def test_flags_less_than_or_equal_match_1(mocker, config):
expected_value = True
mocked_app_config_schema = {
"my_feature": {
"default": expected_value,
"default": False,
"rules": {
"Date less than or equal 2021.10.31": {
"when_match": True,
"when_match": expected_value,
"conditions": [
{
"action": RuleAction.KEY_LESS_THAN_OR_EQUAL_VALUE.value,
Expand All @@ -974,10 +974,10 @@ def test_flags_less_than_or_equal_match_2(mocker, config):
expected_value = True
mocked_app_config_schema = {
"my_feature": {
"default": expected_value,
"default": False,
"rules": {
"Date less than or equal 2021.10.31": {
"when_match": True,
"when_match": expected_value,
"conditions": [
{
"action": RuleAction.KEY_LESS_THAN_OR_EQUAL_VALUE.value,
Expand Down Expand Up @@ -1059,10 +1059,10 @@ def test_flags_greater_than_match(mocker, config):
expected_value = True
mocked_app_config_schema = {
"my_feature": {
"default": expected_value,
"default": False,
"rules": {
"Date greater than 2021.10.31": {
"when_match": True,
"when_match": expected_value,
"conditions": [
{
"action": RuleAction.KEY_GREATER_THAN_VALUE.value,
Expand Down Expand Up @@ -1116,10 +1116,10 @@ def test_flags_greater_than_or_equal_match_1(mocker, config):
expected_value = True
mocked_app_config_schema = {
"my_feature": {
"default": expected_value,
"default": False,
"rules": {
"Date greater than or equal 2021.10.31": {
"when_match": True,
"when_match": expected_value,
"conditions": [
{
"action": RuleAction.KEY_GREATER_THAN_OR_EQUAL_VALUE.value,
Expand All @@ -1144,10 +1144,10 @@ def test_flags_greater_than_or_equal_match_2(mocker, config):
expected_value = True
mocked_app_config_schema = {
"my_feature": {
"default": expected_value,
"default": False,
"rules": {
"Date greater than or equal 2021.10.31": {
"when_match": True,
"when_match": expected_value,
"conditions": [
{
"action": RuleAction.KEY_GREATER_THAN_OR_EQUAL_VALUE.value,
Expand Down