Skip to content

Commit 1b11c95

Browse files
committed
Fix test and add debug
1 parent 8d17427 commit 1b11c95

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

spec/config/datafile_project_config_spec.rb

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,18 @@
12831283
expect(holdouts.length).to eq(1)
12841284
expect(holdouts.first['key']).to eq('global_holdout')
12851285
end
1286+
1287+
it 'debug test data' do
1288+
puts "=== DEBUG INFO ==="
1289+
puts "Holdouts: #{config_with_holdouts.holdouts.inspect}"
1290+
puts "Global holdouts: #{config_with_holdouts.global_holdouts.inspect}"
1291+
puts "Included holdouts: #{config_with_holdouts.included_holdouts.inspect}"
1292+
puts "Excluded holdouts: #{config_with_holdouts.excluded_holdouts.inspect}"
1293+
1294+
# Check feature flag IDs
1295+
puts "Multi variate feature: #{config_with_holdouts.feature_flag_key_map['multi_variate_feature'].inspect}"
1296+
puts "Boolean feature: #{config_with_holdouts.feature_flag_key_map['boolean_single_variable_feature'].inspect}"
1297+
end
12861298
end
12871299

12881300
describe '#get_holdout' do
@@ -1314,6 +1326,18 @@
13141326
holdout = config_with_holdouts.get_holdout('non_existent_holdout')
13151327
expect(holdout).to be_nil
13161328
end
1329+
1330+
it 'debug test data' do
1331+
puts "=== DEBUG INFO ==="
1332+
puts "Holdouts: #{config_with_holdouts.holdouts.inspect}"
1333+
puts "Global holdouts: #{config_with_holdouts.global_holdouts.inspect}"
1334+
puts "Included holdouts: #{config_with_holdouts.included_holdouts.inspect}"
1335+
puts "Excluded holdouts: #{config_with_holdouts.excluded_holdouts.inspect}"
1336+
1337+
# Check feature flag IDs
1338+
puts "Multi variate feature: #{config_with_holdouts.feature_flag_key_map['multi_variate_feature'].inspect}"
1339+
puts "Boolean feature: #{config_with_holdouts.feature_flag_key_map['boolean_single_variable_feature'].inspect}"
1340+
end
13171341
end
13181342

13191343
describe '#get_holdout with logging' do
@@ -1352,6 +1376,18 @@
13521376
anything
13531377
)
13541378
end
1379+
1380+
it 'debug test data' do
1381+
puts "=== DEBUG INFO ==="
1382+
puts "Holdouts: #{config_with_holdouts.holdouts.inspect}"
1383+
puts "Global holdouts: #{config_with_holdouts.global_holdouts.inspect}"
1384+
puts "Included holdouts: #{config_with_holdouts.included_holdouts.inspect}"
1385+
puts "Excluded holdouts: #{config_with_holdouts.excluded_holdouts.inspect}"
1386+
1387+
# Check feature flag IDs
1388+
puts "Multi variate feature: #{config_with_holdouts.feature_flag_key_map['multi_variate_feature'].inspect}"
1389+
puts "Boolean feature: #{config_with_holdouts.feature_flag_key_map['boolean_single_variable_feature'].inspect}"
1390+
end
13551391
end
13561392

13571393
describe 'holdout initialization' do
@@ -1392,13 +1428,17 @@
13921428
multi_variate_feature_id = config_body['featureFlags'].find { |f| f['key'] == 'multi_variate_feature' }['id']
13931429
empty_feature_id = config_body['featureFlags'].find { |f| f['key'] == 'empty_feature' }['id']
13941430

1431+
expect(config_with_complex_holdouts.included_holdouts[multi_variate_feature_id]).not_to be_nil
13951432
expect(config_with_complex_holdouts.included_holdouts[multi_variate_feature_id]).not_to be_empty
1433+
expect(config_with_complex_holdouts.included_holdouts[empty_feature_id]).not_to be_nil
13961434
expect(config_with_complex_holdouts.included_holdouts[empty_feature_id]).not_to be_empty
13971435
expect(config_with_complex_holdouts.included_holdouts[boolean_feature_id]).to be_nil
13981436

13991437
string_feature_id = config_body['featureFlags'].find { |f| f['key'] == 'string_single_variable_feature' }['id']
14001438

1439+
expect(config_with_complex_holdouts.excluded_holdouts[boolean_feature_id]).not_to be_nil
14011440
expect(config_with_complex_holdouts.excluded_holdouts[boolean_feature_id]).not_to be_empty
1441+
expect(config_with_complex_holdouts.excluded_holdouts[string_feature_id]).not_to be_nil
14021442
expect(config_with_complex_holdouts.excluded_holdouts[string_feature_id]).not_to be_empty
14031443
end
14041444

@@ -1408,7 +1448,19 @@
14081448

14091449
boolean_feature_id = config_body['featureFlags'].find { |f| f['key'] == 'boolean_feature' }['id']
14101450
included_for_boolean = config_with_complex_holdouts.included_holdouts[boolean_feature_id]
1411-
expect(included_for_boolean).to be_nil_or_empty
1451+
expect(included_for_boolean).to be_nil
1452+
end
1453+
1454+
it 'debug test data' do
1455+
puts "=== DEBUG INFO ==="
1456+
puts "Holdouts: #{config_with_holdouts.holdouts.inspect}"
1457+
puts "Global holdouts: #{config_with_holdouts.global_holdouts.inspect}"
1458+
puts "Included holdouts: #{config_with_holdouts.included_holdouts.inspect}"
1459+
puts "Excluded holdouts: #{config_with_holdouts.excluded_holdouts.inspect}"
1460+
1461+
# Check feature flag IDs
1462+
puts "Multi variate feature: #{config_with_holdouts.feature_flag_key_map['multi_variate_feature'].inspect}"
1463+
puts "Boolean feature: #{config_with_holdouts.feature_flag_key_map['boolean_single_variable_feature'].inspect}"
14121464
end
14131465
end
14141466
end

0 commit comments

Comments
 (0)