@@ -15,6 +15,7 @@ func getValidRevproxyConfig(t *testing.T) RevproxyConfig {
1515 require .NoError (t , err )
1616 renkuServicesConfig := getValidRenkuServicesConfig (t )
1717 return RevproxyConfig {
18+ EnableV1Services : true ,
1819 RenkuBaseURL : renkuBaseURL ,
1920 ExternalGitlabURL : externalGitlabURL ,
2021 RenkuServices : renkuServicesConfig ,
@@ -32,15 +33,37 @@ func getValidRenkuServicesConfig(t *testing.T) RenkuServicesConfig {
3233 require .NoError (t , err )
3334 uiServerURL , err := url .Parse ("http://ui" )
3435 require .NoError (t , err )
35- searchURL , err := url .Parse ("http://ui" )
36- require .NoError (t , err )
3736 return RenkuServicesConfig {
3837 KG : kgURL ,
3938 Webhook : webhookURL ,
4039 DataService : dataServiceURL ,
4140 Keycloak : keycloakURL ,
4241 UIServer : uiServerURL ,
43- Search : searchURL ,
42+ }
43+ }
44+
45+ func getValidV2OnlyRevproxyConfig (t * testing.T ) RevproxyConfig {
46+ renkuBaseURL , err := url .Parse ("https://renku.example.org" )
47+ require .NoError (t , err )
48+ renkuServicesConfig := getValidV2OnlyRenkuServicesConfig (t )
49+ return RevproxyConfig {
50+ EnableV1Services : false ,
51+ RenkuBaseURL : renkuBaseURL ,
52+ RenkuServices : renkuServicesConfig ,
53+ }
54+ }
55+
56+ func getValidV2OnlyRenkuServicesConfig (t * testing.T ) RenkuServicesConfig {
57+ dataServiceURL , err := url .Parse ("http://data-service" )
58+ require .NoError (t , err )
59+ keycloakURL , err := url .Parse ("http://keycloak" )
60+ require .NoError (t , err )
61+ uiServerURL , err := url .Parse ("http://ui" )
62+ require .NoError (t , err )
63+ return RenkuServicesConfig {
64+ DataService : dataServiceURL ,
65+ Keycloak : keycloakURL ,
66+ UIServer : uiServerURL ,
4467 }
4568}
4669
@@ -52,6 +75,21 @@ func TestValidRevproxyConfig(t *testing.T) {
5275 assert .NoError (t , err )
5376}
5477
78+ func TestValidV2OnlyRevproxyConfig (t * testing.T ) {
79+ config := getValidV2OnlyRevproxyConfig (t )
80+
81+ err := config .Validate ()
82+
83+ // Check that the v1 service configuration is not provided
84+ assert .Nil (t , config .ExternalGitlabURL )
85+ assert .Empty (t , config .RenkuServices .Core .ServiceNames )
86+ assert .Empty (t , config .RenkuServices .Core .ServicePaths )
87+ assert .Nil (t , config .RenkuServices .KG )
88+ assert .Nil (t , config .RenkuServices .Webhook )
89+
90+ assert .NoError (t , err )
91+ }
92+
5593func TestInvalidKGURL (t * testing.T ) {
5694 config := getValidRevproxyConfig (t )
5795 config .RenkuServices .KG = nil
@@ -97,15 +135,6 @@ func TestInvalidUIServerURL(t *testing.T) {
97135 assert .ErrorContains (t , err , "the proxy config is missing the url to ui-server" )
98136}
99137
100- func TestInvalidSearchURL (t * testing.T ) {
101- config := getValidRevproxyConfig (t )
102- config .RenkuServices .Search = nil
103-
104- err := config .Validate ()
105-
106- assert .ErrorContains (t , err , "the proxy config is missing the url to search" )
107- }
108-
109138func TestInvalidCoreSvcConfig (t * testing.T ) {
110139 config := getValidRevproxyConfig (t )
111140 config .RenkuServices .Core .ServiceNames = []string {"core-svc" }
0 commit comments