Skip to content

Access token not passed correctly in api tests

When running certain tests such as api_v4_groups_projects.jsthe token doesn't seem to be passed correctly in the http get request. This results in a 404 error when running the test:

time="2020-03-16T11:04:05Z" level=warning msg="Error detected: '404 Group Not Found'" 

The problem seems to be with this line:

let params = { headers: { "Accept": "application/json" }, "PRIVATE-TOKEN": `${__ENV.ACCESS_TOKEN}` };

The token seems to be outside the params map, and if I rebuild the image with the below line then the test works:

let params = { headers: { "PRIVATE-TOKEN": `${__ENV.ACCESS_TOKEN}` },};

Is there a reason why the token is passed that way or am I missing something?

I am using a standalone gitlab deployment on ubuntu, version 12.8.6-ee.0