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

auto_devops_spec.rb « project « features « specs « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f87b13612f37da52d39b691694c8e9e9f8dd9fea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module QA
  feature 'Auto Devops', :kubernetes do
    let(:executor) { "qa-runner-#{Time.now.to_i}" }

    after do
      @cluster&.remove!
    end

    scenario 'user creates a new project and runs auto devops' do
      @cluster = Service::KubernetesCluster.new.create!
      require 'pry'; binding.pry
      Runtime::Browser.visit(:gitlab, Page::Main::Login)
      Page::Main::Login.act { sign_in_using_credentials }

      project = Factory::Resource::Project.fabricate! do |p|
        p.name = 'project-with-k8s-runner'
        p.description = 'Project with K8s Runner'
      end

      # Create Auto Devops compatible repo
      project.visit!
      Git::Repository.perform do |repository|
        repository.uri = Page::Project::Show.act do
          choose_repository_clone_http
          repository_location.uri
        end

        repository.use_default_credentials
        repository.clone
        repository.configure_identity('GitLab QA', 'root@gitlab.com')

        repository.checkout_new_branch('master')
        repository.add_file('.gitlab-ci.yml', File.read(File.join(__dir__, "../../../fixtures/auto_devops_rack/delete_me-ci.yml")))
        repository.commit('Create auto devops repo')
        repository.push_changes("master:master")
      end

      # Create and connect K8s cluster
      @cluster = Service::KubernetesCluster.new.create!
      kubernetes_cluster = Factory::Resource::KubernetesCluster.fabricate! do |c|
        c.project = project
        c.cluster = @cluster
        c.install_helm_tiller = true
        c.install_runner = true
      end

      project.visit!
      Page::Menu::Side.act { click_ci_cd_pipelines }
      Page::Project::Pipeline::Index.act { go_to_latest_pipeline }

      require 'pry'; binding.pry
    end
  end
end