Skip to content
Snippets Groups Projects
Commit 638d8a9e authored by Stefano Tenuta's avatar Stefano Tenuta
Browse files

Fixed tests for jobs_request_post_spec

Added a test to validate Variables in jobs_request_post_spec
Updated other tests to expect an empty Variables property
parent a0b96c07
No related branches found
No related tags found
1 merge request!72025Resolve "support all options from `docker-compose.yml` in gitlab runner services"
......@@ -443,7 +443,7 @@
options do
{
image: { name: 'ruby:2.7', entrypoint: '/bin/sh' },
services: ['postgres', { name: 'docker:stable-dind', entrypoint: '/bin/sh', command: 'sleep 30', alias: 'docker' }],
services: ['postgres', { name: 'docker:stable-dind', entrypoint: '/bin/sh', command: 'sleep 30', alias: 'docker' }, { name: 'mysql:latest', variables: { MYSQL_ROOT_PASSWORD: 'root123.' } }],
script: %w(echo),
after_script: %w(ls date),
artifacts: {
......
......@@ -218,9 +218,11 @@
expect(json_response['git_info']).to eq(expected_git_info)
expect(json_response['image']).to eq({ 'name' => 'ruby:2.7', 'entrypoint' => '/bin/sh', 'ports' => [] })
expect(json_response['services']).to eq([{ 'name' => 'postgres', 'entrypoint' => nil,
'alias' => nil, 'command' => nil, 'ports' => [] },
'alias' => nil, 'command' => nil, 'ports' => [], 'variables' => nil },
{ 'name' => 'docker:stable-dind', 'entrypoint' => '/bin/sh',
'alias' => 'docker', 'command' => 'sleep 30', 'ports' => [] }])
'alias' => 'docker', 'command' => 'sleep 30', 'ports' => [], 'variables' => [] },
{ 'name' => 'mysql:latest', 'entrypoint' => nil,
'alias' => nil, 'command' => nil, 'ports' => [], 'variables' => [{ key: 'MYSQL_ROOT_PASSWORD', value: 'root123.' }.as_json] }])
expect(json_response['steps']).to eq(expected_steps)
expect(json_response['artifacts']).to eq(expected_artifacts)
expect(json_response['cache']).to eq(expected_cache)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment