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
path: root/spec
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-06-01 13:29:11 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-06-01 13:29:11 +0300
commit4f8a1c0d4cc9372823cb28a16936c49dd4f09402 (patch)
tree55ecd7123d35b302ad2f258bd891c0ef08e4fe30 /spec
parent20dcd522f0a3cf2603047bcd296eae254487fa5a (diff)
Just use the url from options, not saving it as a column
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/ci/builds.rb1
-rw-r--r--spec/lib/ci/gitlab_ci_yaml_processor_spec.rb9
-rw-r--r--spec/lib/gitlab/import_export/safe_model_attributes.yml1
-rw-r--r--spec/models/ci/build_spec.rb7
4 files changed, 3 insertions, 15 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb
index aeabb57c512..0bb5a86d9b9 100644
--- a/spec/factories/ci/builds.rb
+++ b/spec/factories/ci/builds.rb
@@ -63,7 +63,6 @@ FactoryGirl.define do
trait :teardown_environment do
environment 'staging'
- environment_url 'http://staging.example.com/$CI_JOB_NAME'
options environment: { name: 'staging',
action: 'stop',
url: 'http://staging.example.com/$CI_JOB_NAME' }
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
index 177b31aba33..fe2c00bb2ca 100644
--- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
@@ -105,7 +105,6 @@ module Ci
allow_failure: false,
when: "on_success",
environment: nil,
- environment_url: nil,
yaml_variables: []
})
end
@@ -524,7 +523,6 @@ module Ci
allow_failure: false,
when: "on_success",
environment: nil,
- environment_url: nil,
yaml_variables: []
})
end
@@ -554,7 +552,6 @@ module Ci
allow_failure: false,
when: "on_success",
environment: nil,
- environment_url: nil,
yaml_variables: []
})
end
@@ -801,7 +798,6 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
- environment_url: nil,
yaml_variables: []
})
end
@@ -853,7 +849,6 @@ module Ci
it 'does return production and URL' do
expect(builds.size).to eq(1)
expect(builds.first[:environment]).to eq(environment[:name])
- expect(builds.first[:environment_url]).to eq(environment[:url])
expect(builds.first[:options]).to include(environment: environment)
end
@@ -866,7 +861,6 @@ module Ci
it 'allows a variable for the port' do
expect(builds.size).to eq(1)
expect(builds.first[:environment]).to eq(environment[:name])
- expect(builds.first[:environment_url]).to eq(environment[:url])
expect(builds.first[:options]).to include(environment: environment)
end
end
@@ -1007,7 +1001,6 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
- environment_url: nil,
yaml_variables: []
})
end
@@ -1054,7 +1047,6 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
- environment_url: nil,
yaml_variables: []
})
expect(subject.second).to eq({
@@ -1068,7 +1060,6 @@ module Ci
when: "on_success",
allow_failure: false,
environment: nil,
- environment_url: nil,
yaml_variables: []
})
end
diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml
index 958784d8382..54ce8051f30 100644
--- a/spec/lib/gitlab/import_export/safe_model_attributes.yml
+++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml
@@ -225,7 +225,6 @@ CommitStatus:
- erased_at
- artifacts_expire_at
- environment
-- environment_url
- artifacts_size
- when
- yaml_variables
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 2df439819ef..141a2741ced 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -20,7 +20,6 @@ describe Ci::Build, :models do
it { is_expected.to validate_presence_of(:ref) }
it { is_expected.to respond_to(:has_trace?) }
it { is_expected.to respond_to(:trace) }
- it { is_expected.to validate_length_of(:environment_url).is_at_most(255) }
describe '#actionize' do
context 'when build is a created' do
@@ -435,7 +434,7 @@ describe Ci::Build, :models do
let(:build) do
create(:ci_build,
ref: 'master',
- environment_url: 'http://review/$CI_COMMIT_REF_NAME')
+ options: { environment: { url: 'http://review/$CI_COMMIT_REF_NAME' } })
end
it { is_expected.to eq('http://review/master') }
@@ -445,7 +444,7 @@ describe Ci::Build, :models do
let(:build) do
create(:ci_build,
yaml_variables: [{ key: :APP_HOST, value: 'host' }],
- environment_url: 'http://review/$APP_HOST')
+ options: { environment: { url: 'http://review/$APP_HOST' } })
end
it { is_expected.to eq('http://review/host') }
@@ -1244,7 +1243,7 @@ describe Ci::Build, :models do
context 'when the URL was set from the job' do
before do
- build.update(environment_url: 'http://host/$CI_JOB_NAME')
+ build.update(options: { environment: { url: 'http://host/$CI_JOB_NAME' } })
end
it_behaves_like 'containing environment variables'