@@ -89,7 +89,7 @@ func (s *gitlabPipelineSuite) TestListEnvVars() {
8989 {"CI_JOB_URL" , false },
9090 {"CI_PIPELINE_URL" , false },
9191 {"CI_RUNNER_VERSION" , false },
92- {"CI_RUNNER_DESCRIPTION" , false },
92+ {"CI_RUNNER_DESCRIPTION" , true },
9393 {"CI_COMMIT_REF_NAME" , false },
9494 }, s .runner .ListEnvVars ())
9595}
@@ -111,6 +111,26 @@ func (s *gitlabPipelineSuite) TestResolveEnvVars() {
111111 }, resolvedEnvVars )
112112}
113113
114+ func (s * gitlabPipelineSuite ) TestResolveEnvVarsWithoutRunnerDescription () {
115+ s .T ().Setenv ("CI_RUNNER_DESCRIPTION" , "" )
116+
117+ resolvedEnvVars , errors := s .runner .ResolveEnvVars ()
118+ s .Empty (errors , "Should not error when CI_RUNNER_DESCRIPTION is missing" )
119+
120+ expected := map [string ]string {
121+ "GITLAB_USER_EMAIL" : "foo@foo.com" ,
122+ "GITLAB_USER_LOGIN" : "foo" ,
123+ "CI_PROJECT_URL" : "https://gitlab.com/chainloop/chainloop" ,
124+ "CI_COMMIT_SHA" : "1234567890" ,
125+ "CI_JOB_URL" : "https://gitlab.com/chainloop/chainloop/-/jobs/123" ,
126+ "CI_PIPELINE_URL" : "https://gitlab.com/chainloop/chainloop/-/pipelines/123" ,
127+ "CI_RUNNER_VERSION" : "13.10.0" ,
128+ "CI_COMMIT_REF_NAME" : "main" ,
129+ "CI_SERVER_URL" : "https://gitlab.com" ,
130+ }
131+ s .Equal (expected , resolvedEnvVars )
132+ }
133+
114134func (s * gitlabPipelineSuite ) TestRunURI () {
115135 s .Equal ("https://gitlab.com/chainloop/chainloop/-/jobs/123" , s .runner .RunURI ())
116136}
0 commit comments