Commit f698fdbd authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 6af29c94
---
title: Replace CI_COMMIT_REF with CI_COMMIT_SHA on CI docs
merge_request: 21781
author: Takuya Noguchi
type: other
...@@ -171,6 +171,32 @@ cpp: ...@@ -171,6 +171,32 @@ cpp:
junit: report.xml junit: report.xml
``` ```
### .Net example
The [JunitXML.TestLogger](https://www.nuget.org/packages/JunitXml.TestLogger/) NuGet
package can generate test reports for .Net Framework and .Net Core applications. The following
example expects a solution in the root folder of the repository, with one or more
project files in sub-folders. One result file is produced per test project, and each file
is placed in a new artifacts folder. This example includes optional formatting arguments, which
improve the readability of test data in the test widget. A full .Net Core
[example is available](https://gitlab.com/Siphonophora/dot-net-cicd-test-logging-demo).
```yaml
## Source code and documentation are here: https://github.com/spekt/junit.testlogger/
Test:
stage: test
script:
- 'dotnet test --test-adapter-path:. --logger:"junit;LogFilePath=..\artifacts\{assembly}-test-result.xml;MethodFormat=Class;FailureBodyFormat=Verbose"'
artifacts:
when: always
paths:
- ./**/*test-result.xml
reports:
junit:
- ./**/*test-result.xml
```
## Limitations ## Limitations
Currently, the following tools might not work because their XML formats are unsupported in GitLab. Currently, the following tools might not work because their XML formats are unsupported in GitLab.
......
...@@ -699,8 +699,8 @@ Running on runner-8a2f473d-project-1796893-concurrent-0 via runner-8a2f473d-mach ...@@ -699,8 +699,8 @@ Running on runner-8a2f473d-project-1796893-concurrent-0 via runner-8a2f473d-mach
++ CI_JOB_ID=7046507 ++ CI_JOB_ID=7046507
++ export CI_JOB_TOKEN=xxxxxxxxxxxxxxxxxxxx ++ export CI_JOB_TOKEN=xxxxxxxxxxxxxxxxxxxx
++ CI_JOB_TOKEN=xxxxxxxxxxxxxxxxxxxx ++ CI_JOB_TOKEN=xxxxxxxxxxxxxxxxxxxx
++ export CI_COMMIT_REF=dd648b2e48ce6518303b0bb580b2ee32fadaf045 ++ export CI_COMMIT_SHA=dd648b2e48ce6518303b0bb580b2ee32fadaf045
++ CI_COMMIT_REF=dd648b2e48ce6518303b0bb580b2ee32fadaf045 ++ CI_COMMIT_SHA=dd648b2e48ce6518303b0bb580b2ee32fadaf045
++ export CI_COMMIT_BEFORE_SHA=dd648b2e48ce6518303b0bb580b2ee32fadaf045 ++ export CI_COMMIT_BEFORE_SHA=dd648b2e48ce6518303b0bb580b2ee32fadaf045
++ CI_COMMIT_BEFORE_SHA=dd648b2e48ce6518303b0bb580b2ee32fadaf045 ++ CI_COMMIT_BEFORE_SHA=dd648b2e48ce6518303b0bb580b2ee32fadaf045
++ export CI_COMMIT_REF_NAME=master ++ export CI_COMMIT_REF_NAME=master
......
...@@ -1148,6 +1148,8 @@ failure. ...@@ -1148,6 +1148,8 @@ failure.
1. `always` - execute job regardless of the status of jobs from prior stages. 1. `always` - execute job regardless of the status of jobs from prior stages.
1. `manual` - execute job manually (added in GitLab 8.10). Read about 1. `manual` - execute job manually (added in GitLab 8.10). Read about
[manual actions](#whenmanual) below. [manual actions](#whenmanual) below.
1. `delayed` - execute job after a certain period (added in GitLab 11.14).
Read about [delayed actions](#whendelayed) below.
For example: For example:
......
...@@ -1268,6 +1268,30 @@ Everything behaves the same way, except: ...@@ -1268,6 +1268,30 @@ Everything behaves the same way, except:
1. `timed rollout 50%` 1. `timed rollout 50%`
1. `timed rollout 100%` 1. `timed rollout 100%`
### Auto DevOps banner
The following Auto DevOps banner will show for maintainers+ on new projects when Auto DevOps is not
enabled:
![Auto DevOps banner](img/autodevops_banner_v12_6.png)
The banner can be disabled for:
- A user when they dismiss it themselves.
- A project by explicitly [disabling Auto DevOps](#enablingdisabling-auto-devops).
- An entire GitLab instance:
- By an administrator running the following in a Rails console:
```ruby
Feature.get(:auto_devops_banner_disabled).enable
```
- Through the REST API with an admin access token:
```sh
curl --data "value=true" --header "PRIVATE-TOKEN: <personal_access_token>" https://gitlab.example.com/api/v4/features/auto_devops_banner_disabled
```
## Currently supported languages ## Currently supported languages
Note that not all buildpacks support Auto Test yet, as it's a relatively new Note that not all buildpacks support Auto Test yet, as it's a relatively new
...@@ -1340,29 +1364,6 @@ spec: ...@@ -1340,29 +1364,6 @@ spec:
service account for your project. For help debugging this issue, see service account for your project. For help debugging this issue, see
[Troubleshooting failed deployment jobs](../../user/project/clusters/index.md#troubleshooting). [Troubleshooting failed deployment jobs](../../user/project/clusters/index.md#troubleshooting).
### Auto DevOps banner
The following Auto DevOps banner will show for maintainers+ on new projects when Auto DevOps is not enabled
![Auto DevOps banner](img/autodevops_banner_v12_6.png)
The banner can be disabled:
- Per user when they dismiss it.
- Project-wide by explicitly [disabling Auto DevOps](#enablingdisabling-auto-devops).
- By a GitLab administrator for an entire GitLab instance by either:
- Running the following in a Rails console:
```ruby
Feature.get(:auto_devops_banner_disabled).enable
```
- Through the REST API with an admin access token:
```sh
curl --data "value=true" --header "PRIVATE-TOKEN: personal_access_token" https://gitlab.example.com/api/v4/features/auto_devops_banner_disabled
```
[ce-37115]: https://gitlab.com/gitlab-org/gitlab-foss/issues/37115 [ce-37115]: https://gitlab.com/gitlab-org/gitlab-foss/issues/37115
[docker-in-docker]: ../../docker/using_docker_build.md#use-docker-in-docker-executor [docker-in-docker]: ../../docker/using_docker_build.md#use-docker-in-docker-executor
[review-app]: ../../ci/review_apps/index.md [review-app]: ../../ci/review_apps/index.md
......
...@@ -5,33 +5,33 @@ module QA ...@@ -5,33 +5,33 @@ module QA
module Login module Login
module_function module_function
def while_signed_in(as: nil) def while_signed_in(as: nil, address: :gitlab)
Page::Main::Menu.perform(&:sign_out_if_signed_in) Page::Main::Menu.perform(&:sign_out_if_signed_in)
sign_in(as: as) sign_in(as: as, address: address)
yield yield
Page::Main::Menu.perform(&:sign_out) Page::Main::Menu.perform(&:sign_out)
end end
def while_signed_in_as_admin def while_signed_in_as_admin(address: :gitlab)
while_signed_in(as: Runtime::User.admin) do while_signed_in(as: Runtime::User.admin, address: address) do
yield yield
end end
end end
def sign_in(as: nil) def sign_in(as: nil, address: :gitlab)
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(address, Page::Main::Login)
Page::Main::Login.perform { |login| login.sign_in_using_credentials(user: as) } Page::Main::Login.perform { |login| login.sign_in_using_credentials(user: as) }
end end
def sign_in_as_admin def sign_in_as_admin(address: :gitlab)
sign_in(as: Runtime::User.admin) sign_in(as: Runtime::User.admin, address: address)
end end
def sign_in_unless_signed_in(as: nil) def sign_in_unless_signed_in(as: nil, address: :gitlab)
sign_in(as: as) unless Page::Main::Menu.perform(&:signed_in?) sign_in(as: as, address: address) unless Page::Main::Menu.perform(&:signed_in?)
end end
end end
end end
......
...@@ -27,7 +27,7 @@ module QA::Page ...@@ -27,7 +27,7 @@ module QA::Page
wait(reload: false, max: wait, interval: 1) do wait(reload: false, max: wait, interval: 1) do
result = find_element(:build_trace).text result = find_element(:build_trace).text
!result.empty? result.include?('Job')
end end
result result
......
...@@ -226,7 +226,7 @@ module QA ...@@ -226,7 +226,7 @@ module QA
end end
def gcloud_region def gcloud_region
ENV.fetch('GCLOUD_REGION') ENV['GCLOUD_REGION']
end end
def gcloud_num_nodes def gcloud_num_nodes
......
# frozen_string_literal: true # frozen_string_literal: true
require 'active_support/inflector'
module QA module QA
module Service module Service
module ClusterProvider module ClusterProvider
...@@ -8,8 +10,22 @@ module QA ...@@ -8,8 +10,22 @@ module QA
find_executable('gcloud') || raise("You must first install `gcloud` executable to run these tests.") find_executable('gcloud') || raise("You must first install `gcloud` executable to run these tests.")
end end
def initialize(rbac:)
super(rbac: rbac)
@attempts = 0
@available_regions = %w(
asia-east1 asia-east2
asia-northeast1 asia-south1
asia-southeast1 australia-southeast1
europe-west1 europe-west2 europe-west4
northamerica-northeast1 southamerica-east1
us-central1 us-east1 us-east4
us-west1 us-west2
)
end
def set_credentials(admin_user) def set_credentials(admin_user)
master_auth = JSON.parse(`gcloud container clusters describe #{cluster_name} --region #{Runtime::Env.gcloud_region} --format 'json(masterAuth.username, masterAuth.password)'`) master_auth = JSON.parse(`gcloud container clusters describe #{cluster_name} --region #{@region} --format 'json(masterAuth.username, masterAuth.password)'`)
shell <<~CMD.tr("\n", ' ') shell <<~CMD.tr("\n", ' ')
kubectl config set-credentials #{admin_user} kubectl config set-credentials #{admin_user}
...@@ -58,29 +74,41 @@ module QA ...@@ -58,29 +74,41 @@ module QA
end end
def create_cluster def create_cluster
@region = get_region
shell <<~CMD.tr("\n", ' ') shell <<~CMD.tr("\n", ' ')
gcloud container clusters gcloud container clusters
create #{cluster_name} create #{cluster_name}
#{auth_options} #{auth_options}
--enable-basic-auth --enable-basic-auth
--region #{Runtime::Env.gcloud_region} --region #{@region}
--disk-size 10GB --disk-size 10GB
--num-nodes #{Runtime::Env.gcloud_num_nodes} --num-nodes #{Runtime::Env.gcloud_num_nodes}
&& gcloud container clusters && gcloud container clusters
get-credentials get-credentials
--region #{Runtime::Env.gcloud_region} --region #{@region}
#{cluster_name} #{cluster_name}
CMD CMD
rescue QA::Service::Shellout::CommandError
@attempts += 1
retry unless @attempts > 1
raise $!, "Tried and failed to provision the cluster #{@attempts} #{"time".pluralize(@attempts)}.", $!.backtrace
end end
def delete_cluster def delete_cluster
shell <<~CMD.tr("\n", ' ') shell <<~CMD.tr("\n", ' ')
gcloud container clusters delete gcloud container clusters delete
--region #{Runtime::Env.gcloud_region} --region #{@region}
#{cluster_name} #{cluster_name}
--quiet --async --quiet --async
CMD CMD
end end
def get_region
Runtime::Env.gcloud_region || @available_regions.delete(@available_regions.sample)
end
end end
end end
end end
......
...@@ -25,6 +25,14 @@ describe Gitlab::SidekiqMiddleware do ...@@ -25,6 +25,14 @@ describe Gitlab::SidekiqMiddleware do
# 1) not failing # 1) not failing
# 2) yielding exactly once # 2) yielding exactly once
describe '.server_configurator' do describe '.server_configurator' do
around do |example|
original = Sidekiq::Testing.server_middleware.dup
example.run
Sidekiq::Testing.instance_variable_set :@server_chain, original
end
let(:middleware_expected_args) { [a_kind_of(worker_class), hash_including({ 'args' => job_args }), anything] } let(:middleware_expected_args) { [a_kind_of(worker_class), hash_including({ 'args' => job_args }), anything] }
let(:all_sidekiq_middlewares) do let(:all_sidekiq_middlewares) do
[ [
......
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