Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/ci/templates/katalon_gitlab_ci_yaml_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/templates/katalon_gitlab_ci_yaml_spec.rb52
1 files changed, 52 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/templates/katalon_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/katalon_gitlab_ci_yaml_spec.rb
new file mode 100644
index 00000000000..5a62324da74
--- /dev/null
+++ b/spec/lib/gitlab/ci/templates/katalon_gitlab_ci_yaml_spec.rb
@@ -0,0 +1,52 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'Katalon.gitlab-ci.yml' do
+ subject(:template) do
+ <<~YAML
+ include:
+ - template: 'Katalon.gitlab-ci.yml'
+
+ katalon_tests_placeholder:
+ extends: .katalon_tests
+ stage: test
+ script:
+ - echo "katalon tests"
+
+ katalon_tests_with_artifacts_placeholder:
+ extends: .katalon_tests_with_artifacts
+ stage: test
+ script:
+ - echo "katalon tests with artifacts"
+ YAML
+ end
+
+ describe 'the created pipeline' do
+ let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
+ let(:user) { project.first_owner }
+
+ let(:service) { Ci::CreatePipelineService.new(project, user, ref: 'master' ) }
+ let(:pipeline) { service.execute!(:push).payload }
+ let(:build_names) { pipeline.builds.pluck(:name) }
+
+ before do
+ stub_ci_pipeline_yaml_file(template)
+ end
+
+ it 'create katalon tests jobs' do
+ expect(build_names).to match_array(%w[katalon_tests_placeholder katalon_tests_with_artifacts_placeholder])
+
+ expect(pipeline.builds.find_by(name: 'katalon_tests_placeholder').options).to include(
+ image: { name: 'katalonstudio/katalon' },
+ services: [{ name: 'docker:dind' }]
+ )
+
+ expect(pipeline.builds.find_by(name: 'katalon_tests_with_artifacts_placeholder').options).to include(
+ image: { name: 'katalonstudio/katalon' },
+ services: [{ name: 'docker:dind' }],
+ artifacts: { when: 'always', paths: ['Reports/'], reports: { junit: ['Reports/*/*/*/*.xml'] } }
+ )
+ end
+ end
+end