@@ -1974,77 +1974,87 @@ func TestToApiExperimentsV1(t *testing.T) {
1974
1974
1975
1975
func TestToApiExperiments (t * testing.T ) {
1976
1976
exp1 := & model.Experiment {
1977
- UUID : "exp1" ,
1978
- CreatedAtInSec : 1 ,
1979
- Name : "experiment1" ,
1980
- Description : "My name is experiment1" ,
1981
- StorageState : "AVAILABLE" ,
1977
+ UUID : "exp1" ,
1978
+ CreatedAtInSec : 1 ,
1979
+ LastRunCreatedAtInSec : 1 ,
1980
+ Name : "experiment1" ,
1981
+ Description : "My name is experiment1" ,
1982
+ StorageState : "AVAILABLE" ,
1982
1983
}
1983
1984
exp2 := & model.Experiment {
1984
- UUID : "exp2" ,
1985
- CreatedAtInSec : 2 ,
1986
- Name : "experiment2" ,
1987
- Description : "My name is experiment2" ,
1988
- StorageState : "ARCHIVED" ,
1985
+ UUID : "exp2" ,
1986
+ CreatedAtInSec : 2 ,
1987
+ LastRunCreatedAtInSec : 2 ,
1988
+ Name : "experiment2" ,
1989
+ Description : "My name is experiment2" ,
1990
+ StorageState : "ARCHIVED" ,
1989
1991
}
1990
1992
exp3 := & model.Experiment {
1991
- UUID : "exp3" ,
1992
- CreatedAtInSec : 1 ,
1993
- Name : "experiment3" ,
1994
- Description : "experiment3 was created using V1 APIV1BETA1" ,
1995
- StorageState : "STORAGESTATE_AVAILABLE" ,
1993
+ UUID : "exp3" ,
1994
+ CreatedAtInSec : 1 ,
1995
+ LastRunCreatedAtInSec : 1 ,
1996
+ Name : "experiment3" ,
1997
+ Description : "experiment3 was created using V1 APIV1BETA1" ,
1998
+ StorageState : "STORAGESTATE_AVAILABLE" ,
1996
1999
}
1997
2000
exp4 := & model.Experiment {
1998
- UUID : "exp4" ,
1999
- CreatedAtInSec : 2 ,
2000
- Name : "experiment4" ,
2001
- Description : "experiment4 was created using V1 APIV1BETA1" ,
2002
- StorageState : "STORAGESTATE_ARCHIVED" ,
2001
+ UUID : "exp4" ,
2002
+ CreatedAtInSec : 2 ,
2003
+ LastRunCreatedAtInSec : 2 ,
2004
+ Name : "experiment4" ,
2005
+ Description : "experiment4 was created using V1 APIV1BETA1" ,
2006
+ StorageState : "STORAGESTATE_ARCHIVED" ,
2003
2007
}
2004
2008
exp5 := & model.Experiment {
2005
- UUID : "exp5" ,
2006
- CreatedAtInSec : 1 ,
2007
- Name : "experiment5" ,
2008
- Description : "My name is experiment5" ,
2009
- StorageState : "this is invalid storage state" ,
2009
+ UUID : "exp5" ,
2010
+ CreatedAtInSec : 1 ,
2011
+ LastRunCreatedAtInSec : 1 ,
2012
+ Name : "experiment5" ,
2013
+ Description : "My name is experiment5" ,
2014
+ StorageState : "this is invalid storage state" ,
2010
2015
}
2011
2016
apiExps := toApiExperiments ([]* model.Experiment {exp1 , exp2 , exp3 , exp4 , nil , exp5 })
2012
2017
expectedApiExps := []* apiv2beta1.Experiment {
2013
2018
{
2014
- ExperimentId : "exp1" ,
2015
- DisplayName : "experiment1" ,
2016
- Description : "My name is experiment1" ,
2017
- CreatedAt : & timestamp.Timestamp {Seconds : 1 },
2018
- StorageState : apiv2beta1 .Experiment_StorageState (apiv2beta1 .Experiment_StorageState_value ["AVAILABLE" ]),
2019
+ ExperimentId : "exp1" ,
2020
+ DisplayName : "experiment1" ,
2021
+ Description : "My name is experiment1" ,
2022
+ CreatedAt : & timestamp.Timestamp {Seconds : 1 },
2023
+ LastRunCreatedAt : & timestamp.Timestamp {Seconds : 1 },
2024
+ StorageState : apiv2beta1 .Experiment_StorageState (apiv2beta1 .Experiment_StorageState_value ["AVAILABLE" ]),
2019
2025
},
2020
2026
{
2021
- ExperimentId : "exp2" ,
2022
- DisplayName : "experiment2" ,
2023
- Description : "My name is experiment2" ,
2024
- CreatedAt : & timestamp.Timestamp {Seconds : 2 },
2025
- StorageState : apiv2beta1 .Experiment_StorageState (apiv2beta1 .Experiment_StorageState_value ["ARCHIVED" ]),
2027
+ ExperimentId : "exp2" ,
2028
+ DisplayName : "experiment2" ,
2029
+ Description : "My name is experiment2" ,
2030
+ CreatedAt : & timestamp.Timestamp {Seconds : 2 },
2031
+ LastRunCreatedAt : & timestamp.Timestamp {Seconds : 2 },
2032
+ StorageState : apiv2beta1 .Experiment_StorageState (apiv2beta1 .Experiment_StorageState_value ["ARCHIVED" ]),
2026
2033
},
2027
2034
{
2028
- ExperimentId : "exp3" ,
2029
- DisplayName : "experiment3" ,
2030
- Description : "experiment3 was created using V1 APIV1BETA1" ,
2031
- CreatedAt : & timestamp.Timestamp {Seconds : 1 },
2032
- StorageState : apiv2beta1 .Experiment_StorageState (apiv2beta1 .Experiment_StorageState_value ["AVAILABLE" ]),
2035
+ ExperimentId : "exp3" ,
2036
+ DisplayName : "experiment3" ,
2037
+ Description : "experiment3 was created using V1 APIV1BETA1" ,
2038
+ CreatedAt : & timestamp.Timestamp {Seconds : 1 },
2039
+ LastRunCreatedAt : & timestamp.Timestamp {Seconds : 1 },
2040
+ StorageState : apiv2beta1 .Experiment_StorageState (apiv2beta1 .Experiment_StorageState_value ["AVAILABLE" ]),
2033
2041
},
2034
2042
{
2035
- ExperimentId : "exp4" ,
2036
- DisplayName : "experiment4" ,
2037
- Description : "experiment4 was created using V1 APIV1BETA1" ,
2038
- CreatedAt : & timestamp.Timestamp {Seconds : 2 },
2039
- StorageState : apiv2beta1 .Experiment_StorageState (apiv2beta1 .Experiment_StorageState_value ["ARCHIVED" ]),
2043
+ ExperimentId : "exp4" ,
2044
+ DisplayName : "experiment4" ,
2045
+ Description : "experiment4 was created using V1 APIV1BETA1" ,
2046
+ CreatedAt : & timestamp.Timestamp {Seconds : 2 },
2047
+ LastRunCreatedAt : & timestamp.Timestamp {Seconds : 2 },
2048
+ StorageState : apiv2beta1 .Experiment_StorageState (apiv2beta1 .Experiment_StorageState_value ["ARCHIVED" ]),
2040
2049
},
2041
2050
{},
2042
2051
{
2043
- ExperimentId : "exp5" ,
2044
- DisplayName : "experiment5" ,
2045
- Description : "My name is experiment5" ,
2046
- CreatedAt : & timestamp.Timestamp {Seconds : 1 },
2047
- StorageState : apiv2beta1 .Experiment_StorageState (apiv2beta1 .Experiment_StorageState_value ["STORAGE_STATE_UNSPECIFIED" ]),
2052
+ ExperimentId : "exp5" ,
2053
+ DisplayName : "experiment5" ,
2054
+ Description : "My name is experiment5" ,
2055
+ CreatedAt : & timestamp.Timestamp {Seconds : 1 },
2056
+ LastRunCreatedAt : & timestamp.Timestamp {Seconds : 1 },
2057
+ StorageState : apiv2beta1 .Experiment_StorageState (apiv2beta1 .Experiment_StorageState_value ["STORAGE_STATE_UNSPECIFIED" ]),
2048
2058
},
2049
2059
}
2050
2060
assert .Equal (t , expectedApiExps , apiExps )
0 commit comments