File tree Expand file tree Collapse file tree 3 files changed +13
-22
lines changed
Expand file tree Collapse file tree 3 files changed +13
-22
lines changed Original file line number Diff line number Diff line change @@ -1736,6 +1736,19 @@ public void TestTypeFieldParsedCorrectly()
17361736 Assert . AreEqual ( "fr" , rolloutExperiment . Type ) ;
17371737 }
17381738
1739+ [ Test ]
1740+ public void TestUnknownExperimentTypeAccepted ( )
1741+ {
1742+ var datafile = BuildFeatureRolloutDatafile ( experimentType : "new_unknown_type" ) ;
1743+ var config = DatafileProjectConfig . Create ( datafile , LoggerMock . Object ,
1744+ ErrorHandlerMock . Object ) ;
1745+
1746+ Assert . IsNotNull ( config ) ;
1747+ var experiment = config . GetExperimentFromKey ( "rollout_experiment" ) ;
1748+ Assert . IsNotNull ( experiment ) ;
1749+ Assert . AreEqual ( "new_unknown_type" , experiment . Type ) ;
1750+ }
1751+
17391752 #endregion
17401753 }
17411754}
Original file line number Diff line number Diff line change @@ -375,26 +375,8 @@ private void Initialize()
375375 }
376376 }
377377
378- var validExperimentTypes = new HashSet < string >
379- {
380- Experiment . EXPERIMENT_TYPE_AB ,
381- Experiment . EXPERIMENT_TYPE_MAB ,
382- Experiment . EXPERIMENT_TYPE_CMAB ,
383- Experiment . EXPERIMENT_TYPE_TD ,
384- Experiment . EXPERIMENT_TYPE_FR ,
385- } ;
386-
387378 foreach ( var experiment in _ExperimentIdMap . Values )
388379 {
389- if ( experiment . Type != null && ! validExperimentTypes . Contains ( experiment . Type ) )
390- {
391- Logger . Log ( LogLevel . ERROR ,
392- $@ "Experiment ""{ experiment . Key } "" has invalid type ""{ experiment . Type } "".") ;
393- ErrorHandler . HandleError (
394- new InvalidExperimentException (
395- $ "Invalid experiment type: { experiment . Type } ") ) ;
396- }
397-
398380 _VariationKeyMap [ experiment . Key ] = new Dictionary < string , Variation > ( ) ;
399381 _VariationIdMap [ experiment . Key ] = new Dictionary < string , Variation > ( ) ;
400382 _VariationIdMapByExperimentId [ experiment . Id ] = new Dictionary < string , Variation > ( ) ;
Original file line number Diff line number Diff line change @@ -23,10 +23,6 @@ public class Experiment : ExperimentCore
2323 {
2424 private const string MUTEX_GROUP_POLICY = "random" ;
2525
26- public const string EXPERIMENT_TYPE_AB = "ab" ;
27- public const string EXPERIMENT_TYPE_MAB = "mab" ;
28- public const string EXPERIMENT_TYPE_CMAB = "cmab" ;
29- public const string EXPERIMENT_TYPE_TD = "td" ;
3026 public const string EXPERIMENT_TYPE_FR = "fr" ;
3127
3228 /// <summary>
You can’t perform that action at this time.
0 commit comments