@@ -1788,12 +1788,15 @@ func TestWorkspaceWithRichParameters(t *testing.T) {
1788
1788
1789
1789
const (
1790
1790
firstParameterName = "first_parameter"
1791
+ firstParameterType = "string"
1791
1792
firstParameterDescription = "This is first parameter"
1792
1793
firstParameterValue = "1"
1793
1794
1794
- secondParameterName = "second_parameter"
1795
- secondParameterDescription = "This is second parameter"
1796
- secondParameterValue = "2"
1795
+ secondParameterName = "second_parameter"
1796
+ secondParameterType = "number"
1797
+ secondParameterDescription = "This is second parameter"
1798
+ secondParameterValue = "2"
1799
+ secondParameterValidationMonotonic = codersdk .MonotonicOrderIncreasing
1797
1800
)
1798
1801
1799
1802
client := coderdtest .New (t , & coderdtest.Options {IncludeProvisionerDaemon : true })
@@ -1805,8 +1808,17 @@ func TestWorkspaceWithRichParameters(t *testing.T) {
1805
1808
Type : & proto.Provision_Response_Complete {
1806
1809
Complete : & proto.Provision_Complete {
1807
1810
Parameters : []* proto.RichParameter {
1808
- {Name : firstParameterName , Description : firstParameterDescription },
1809
- {Name : secondParameterName , Description : secondParameterDescription },
1811
+ {
1812
+ Name : firstParameterName ,
1813
+ Type : firstParameterType ,
1814
+ Description : firstParameterDescription ,
1815
+ },
1816
+ {
1817
+ Name : secondParameterName ,
1818
+ Type : secondParameterType ,
1819
+ Description : secondParameterDescription ,
1820
+ ValidationMonotonic : string (secondParameterValidationMonotonic ),
1821
+ },
1810
1822
},
1811
1823
},
1812
1824
},
@@ -1826,7 +1838,12 @@ func TestWorkspaceWithRichParameters(t *testing.T) {
1826
1838
require .NoError (t , err )
1827
1839
require .Len (t , templateRichParameters , 2 )
1828
1840
require .Equal (t , templateRichParameters [0 ].Name , firstParameterName )
1841
+ require .Equal (t , templateRichParameters [0 ].Type , firstParameterType )
1842
+ require .Equal (t , templateRichParameters [0 ].ValidationMonotonic , codersdk .ValidationMonotonicOrder ("" )) // no validation for string
1843
+
1829
1844
require .Equal (t , templateRichParameters [1 ].Name , secondParameterName )
1845
+ require .Equal (t , templateRichParameters [1 ].Type , secondParameterType )
1846
+ require .Equal (t , templateRichParameters [1 ].ValidationMonotonic , secondParameterValidationMonotonic )
1830
1847
1831
1848
expectedBuildParameters := []codersdk.WorkspaceBuildParameter {
1832
1849
{Name : firstParameterName , Value : firstParameterValue },
0 commit comments