Commit 4a1e1281 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Revert conflicting EE changes

parent 3cb8f01b
...@@ -48,19 +48,6 @@ FactoryGirl.define do ...@@ -48,19 +48,6 @@ FactoryGirl.define do
end end
end end
trait :kubernetes do
after :create do |project|
project.create_kubernetes_service(
active: true,
properties: {
namespace: project.path,
api_url: 'https://kubernetes.example.com/api',
token: 'a' * 40,
}
)
end
end
# Nest Project Feature attributes # Nest Project Feature attributes
transient do transient do
wiki_access_level ProjectFeature::ENABLED wiki_access_level ProjectFeature::ENABLED
...@@ -150,4 +137,17 @@ FactoryGirl.define do ...@@ -150,4 +137,17 @@ FactoryGirl.define do
) )
end end
end end
factory :kubernetes_project, parent: :empty_project do
after :create do |project|
project.create_kubernetes_service(
active: true,
properties: {
namespace: project.path,
api_url: 'https://kubernetes.example.com',
token: 'a' * 40,
}
)
end
end
end end
...@@ -4,9 +4,17 @@ describe 'Auto deploy' do ...@@ -4,9 +4,17 @@ describe 'Auto deploy' do
include WaitForAjax include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :kubernetes) } let(:project) { create(:project) }
before do before do
project.create_kubernetes_service(
active: true,
properties: {
namespace: project.path,
api_url: 'https://kubernetes.example.com',
token: 'a' * 40,
}
)
project.team << [user, :master] project.team << [user, :master]
login_as user login_as user
end end
......
...@@ -93,7 +93,7 @@ feature 'Environment', :feature do ...@@ -93,7 +93,7 @@ feature 'Environment', :feature do
end end
context 'with terminal' do context 'with terminal' do
let(:project) { create(:empty_project, :kubernetes, :test_repo) } let(:project) { create(:kubernetes_project, :test_repo) }
context 'for project master' do context 'for project master' do
let(:role) { :master } let(:role) { :master }
......
...@@ -151,7 +151,7 @@ feature 'Environments page', :feature, :js do ...@@ -151,7 +151,7 @@ feature 'Environments page', :feature, :js do
end end
context 'with terminal' do context 'with terminal' do
let(:project) { create(:empty_project, :kubernetes, :test_repo) } let(:project) { create(:kubernetes_project, :test_repo) }
context 'for project master' do context 'for project master' do
let(:role) { :master } let(:role) { :master }
......
...@@ -200,7 +200,7 @@ describe Environment, models: true do ...@@ -200,7 +200,7 @@ describe Environment, models: true do
context 'when the enviroment is available' do context 'when the enviroment is available' do
context 'with a deployment service' do context 'with a deployment service' do
let(:project) { create(:empty_project, :kubernetes) } let(:project) { create(:kubernetes_project) }
context 'and a deployment' do context 'and a deployment' do
let!(:deployment) { create(:deployment, environment: environment) } let!(:deployment) { create(:deployment, environment: environment) }
...@@ -218,14 +218,14 @@ describe Environment, models: true do ...@@ -218,14 +218,14 @@ describe Environment, models: true do
end end
context 'when the environment is unavailable' do context 'when the environment is unavailable' do
let(:project) { create(:empty_project, :kubernetes) } let(:project) { create(:kubernetes_project) }
before { environment.stop } before { environment.stop }
it { is_expected.to be_falsy } it { is_expected.to be_falsy }
end end
end end
describe '#terminals' do describe '#terminals' do
let(:project) { create(:empty_project, :kubernetes) } let(:project) { create(:kubernetes_project) }
subject { environment.terminals } subject { environment.terminals }
context 'when the environment has terminals' do context 'when the environment has terminals' do
......
...@@ -4,7 +4,7 @@ describe KubernetesService, models: true, caching: true do ...@@ -4,7 +4,7 @@ describe KubernetesService, models: true, caching: true do
include KubernetesHelpers include KubernetesHelpers
include ReactiveCachingHelpers include ReactiveCachingHelpers
let(:project) { create(:empty_project, :kubernetes) } let(:project) { create(:kubernetes_project) }
let(:service) { project.kubernetes_service } let(:service) { project.kubernetes_service }
# We use Kubeclient to interactive with the Kubernetes API. It will # We use Kubeclient to interactive with the Kubernetes API. It will
......
...@@ -1719,7 +1719,7 @@ describe Project, models: true do ...@@ -1719,7 +1719,7 @@ describe Project, models: true do
end end
context 'when project has a deployment service' do context 'when project has a deployment service' do
let(:project) { create(:empty_project, :kubernetes) } let(:project) { create(:kubernetes_project) }
it 'returns variables from this service' do it 'returns variables from this service' do
expect(project.deployment_variables).to include( expect(project.deployment_variables).to include(
......
require 'spec_helper' require 'spec_helper'
describe ReactiveCachingWorker do describe ReactiveCachingWorker do
let(:project) { create(:empty_project, :kubernetes) } let(:project) { create(:kubernetes_project) }
let(:service) { project.deployment_service } let(:service) { project.deployment_service }
subject { described_class.new.perform("KubernetesService", service.id) } subject { described_class.new.perform("KubernetesService", service.id) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment