Commit ae2088bc authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 3a38c8c1 1f1314a7
......@@ -128,13 +128,11 @@ update-storybook-yarn-cache:
- tmp/tests/frontend/
- knapsack/
# In gitlab-foss, generates FOSS fixtures. In gitlab, generates FOSS & EE fixtures.
# That way, we don't need to have two separate jobs.
rspec-all frontend_fixture:
rspec frontend_fixture:
extends:
- .frontend-fixtures-base
- .frontend:rules:default-frontend-jobs
parallel: 5
parallel: 2
rspec frontend_fixture as-if-foss:
extends:
......@@ -142,6 +140,12 @@ rspec frontend_fixture as-if-foss:
- .frontend:rules:default-frontend-jobs-as-if-foss
- .as-if-foss
rspec-ee frontend_fixture:
extends:
- .frontend-fixtures-base
- .frontend:rules:default-frontend-jobs-ee
parallel: 3
graphql-schema-dump:
variables:
SETUP_DB: "false"
......@@ -192,7 +196,9 @@ jest:
- .frontend:rules:jest
needs:
- job: "detect-tests"
- job: "rspec-all frontend_fixture"
- job: "rspec frontend_fixture"
- job: "rspec-ee frontend_fixture"
optional: true
artifacts:
name: coverage-frontend
expire_in: 31d
......@@ -219,7 +225,9 @@ jest-integration:
script:
- run_timed_command "yarn jest:integration --ci"
needs:
- job: "rspec-all frontend_fixture"
- job: "rspec frontend_fixture"
- job: "rspec-ee frontend_fixture"
optional: true
- job: "graphql-schema-dump"
jest-as-if-foss:
......@@ -333,7 +341,9 @@ startup-css-check:
- .frontend:rules:default-frontend-jobs
needs:
- job: "compile-test-assets"
- job: "rspec-all frontend_fixture"
- job: "rspec frontend_fixture"
- job: "rspec-ee frontend_fixture"
optional: true
startup-css-check as-if-foss:
extends:
......
......@@ -495,6 +495,13 @@
- <<: *if-default-refs
changes: *code-backstage-patterns
.frontend:rules:default-frontend-jobs-ee:
rules:
- <<: *if-not-ee
when: never
- <<: *if-default-refs
changes: *code-backstage-patterns
.frontend:rules:default-frontend-jobs-as-if-foss:
rules:
- <<: *if-not-ee
......
......@@ -29,7 +29,8 @@ update-tests-metadata:
- retrieve-tests-metadata
- setup-test-env
- rspec migration pg12
- rspec-all frontend_fixture
- rspec frontend_fixture
- rspec-ee frontend_fixture
- rspec unit pg12
- rspec integration pg12
- rspec system pg12
......
......@@ -446,10 +446,10 @@ List the artifacts for a single project, sorted by artifact size. The output inc
- on-disk location of the artifact
```ruby
p = Project.find_by_id(:project ID)
p = Project.find_by_id(<project_id>)
arts = Ci::JobArtifact.where(project: p)
list = arts.order('sort DESC').limit(50).each do |art|
list = arts.order(size: :desc).limit(50).each do |art|
puts "Job ID: #{art.job_id} - Size: #{art.size}b - Type: #{art.file_type} - Created: #{art.created_at} - File loc: #{art.file}"
end
```
......
......@@ -31,8 +31,8 @@ The hard-coded rules only permit:
Furthermore, configuration in Workhorse can lead to the image scaler rejecting a request if:
- The image file is too large (controlled by [`max_filesize`](- we only rescale images that do not exceed a configured size in bytes (see [`max_filesize`](https://gitlab.com/gitlab-org/gitlab-workhorse/-/blob/67ab3a2985d2097392f93523ae1cffe0dbf01b31/config.toml.example#L17)))).
- Too many image scalers are already running (controlled by [`max_scaler_procs`](https://gitlab.com/gitlab-org/gitlab-workhorse/-/blob/67ab3a2985d2097392f93523ae1cffe0dbf01b31/config.toml.example#L16)).
- The image file is too large (controlled by [`max_filesize`](- we only rescale images that do not exceed a configured size in bytes (see [`max_filesize`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/workhorse/config.toml.example#L22)))).
- Too many image scalers are already running (controlled by [`max_scaler_procs`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/workhorse/config.toml.example#L21)).
For instance, here are two different URLs that serve the GitLab project avatar both in its
original size and scaled down to 64 pixels. Only the second request will trigger the image scaler:
......@@ -73,7 +73,7 @@ we simply follow the path we take to serve any ordinary upload.
### Workhorse
Assuming Rails decided the request to be valid, Workhorse will take over. Upon receiving the `send-scaled-image`
instruction through the Rails response, a [special response injector](https://gitlab.com/gitlab-org/gitlab-workhorse/-/blob/master/internal/imageresizer/image_resizer.go)
instruction through the Rails response, a [special response injector](https://gitlab.com/gitlab-org/gitlab/-/blob/master/workhorse/internal/imageresizer/image_resizer.go)
will be invoked that knows how to rescale images. The only inputs it requires are the location of the image
(a path if the image resides in block storage, or a URL to remote storage otherwise) and the desired width.
Workhorse will handle the location transparently so Rails does not need to be concerned with where the image
......
......@@ -252,7 +252,7 @@ graph RL;
2_1-1 & 2_1-2 & 2_1-3 & 2_1-4 --> 1-6;
end
2_2-2["rspec-all frontend_fixture (7 minutes)"];
2_2-2["rspec frontend_fixture/rspec-ee frontend_fixture (7 minutes)"];
class 2_2-2 criticalPath;
click 2_2-2 "https://app.periscopedata.com/app/gitlab/652085/Engineering-Productivity---Pipeline-Build-Durations?widget=7910143&udv=0"
2_2-4["memory-on-boot (3.5 minutes)"];
......@@ -284,7 +284,7 @@ graph RL;
3_1-1["jest (14.5 minutes)"];
class 3_1-1 criticalPath;
click 3_1-1 "https://app.periscopedata.com/app/gitlab/652085/Engineering-Productivity---Pipeline-Build-Durations?widget=6914204&udv=0"
subgraph "Needs `rspec-all frontend_fixture`";
subgraph "Needs `rspec frontend_fixture/rspec-ee frontend_fixture`";
3_1-1 --> 2_2-2;
end
......@@ -355,7 +355,7 @@ graph RL;
2_1-1 & 2_1-2 & 2_1-3 & 2_1-4 --> 1-6;
end
2_2-2["rspec-all frontend_fixture (7 minutes)"];
2_2-2["rspec frontend_fixture/rspec-ee frontend_fixture (7 minutes)"];
class 2_2-2 criticalPath;
click 2_2-2 "https://app.periscopedata.com/app/gitlab/652085/Engineering-Productivity---Pipeline-Build-Durations?widget=7910143&udv=0"
2_2-4["memory-on-boot (3.5 minutes)"];
......@@ -395,7 +395,7 @@ graph RL;
3_1-1["jest (14.5 minutes)"];
class 3_1-1 criticalPath;
click 3_1-1 "https://app.periscopedata.com/app/gitlab/652085/Engineering-Productivity---Pipeline-Build-Durations?widget=6914204&udv=0"
subgraph "Needs `rspec-all frontend_fixture`";
subgraph "Needs `rspec frontend_fixture/rspec-ee frontend_fixture`";
3_1-1 --> 2_2-2;
end
......
......@@ -33,7 +33,7 @@ tags:
- windows-1809
```
A list of software preinstalled on the Windows images is available at: [Preinstalled software](https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/gcp/windows-containers/blob/master/cookbooks/preinstalled-software/README.md).
A list of software preinstalled on the Windows images is available at: [Preinstalled software](https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/gcp/windows-containers/blob/main/cookbooks/preinstalled-software/README.md).
## GCP Windows image for development
......@@ -57,7 +57,7 @@ Build a Google Cloud image with the above shared runners repository by doing the
1. Clone the repository <https://github.com/rgl/packer-provisioner-windows-update> and `cd` into the cloned directory.
1. Run the command `go build -o packer-provisioner-windows-update` (requires `go` to be installed).
1. Verify `packer-provisioner-windows-update` is in the `PATH` environment variable.
1. Add all [required environment variables](https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/gcp/windows-containers/-/blob/master/packer.json#L2-10)
1. Add all [required environment variables](https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/gcp/windows-containers/-/blob/main/packer.json#L2-10)
in the `packer.json` file to your environment (perhaps use [`direnv`](https://direnv.net/)).
1. Build the image by running the command: `packer build packer.json`.
......
......@@ -9,8 +9,10 @@ module QA
element :directory_name_link
end
def go_to_directory(name)
click_element(:directory_name_link, directory_name: name)
def go_to_directory(name, retry_attempts = 1)
retry_on_exception(max_attempts: retry_attempts, reload: true, sleep_interval: 10) do
click_element(:directory_name_link, directory_name: name)
end
end
end
end
......
......@@ -80,6 +80,8 @@ module QA
end
it 'replicates the job artifact to the secondary Geo site', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1658' do
artifact_page_retry_attempts = 12
Runtime::Logger.debug('Visiting the secondary Geo site')
Flow::Login.while_signed_in(address: :geo_secondary) do
......@@ -107,7 +109,7 @@ module QA
end
Page::Project::Artifact::Show.perform do |artifact|
artifact.go_to_directory(@directory_name)
artifact.go_to_directory(@directory_name, artifact_page_retry_attempts)
expect(artifact).to have_content(@file_name)
end
end
......
......@@ -109,18 +109,14 @@ function rspec_paralellized_job() {
local test_level="${job_name[1]}"
local report_name=$(echo "${CI_JOB_NAME}" | sed -E 's|[/ ]|_|g') # e.g. 'rspec unit pg12 1/24' would become 'rspec_unit_pg12_1_24'
local rspec_opts="${1}"
local spec_folder_prefixes=""
local spec_folder_prefix=""
if [[ "${test_tool}" =~ "-ee" ]]; then
spec_folder_prefixes="'ee/'"
spec_folder_prefix="ee/"
fi
if [[ "${test_tool}" =~ "-jh" ]]; then
spec_folder_prefixes="'jh/'"
fi
if [[ "${test_tool}" =~ "-all" ]]; then
spec_folder_prefixes="['', 'ee/']"
spec_folder_prefix="jh/"
fi
export KNAPSACK_LOG_LEVEL="debug"
......@@ -135,7 +131,7 @@ function rspec_paralellized_job() {
cp "${KNAPSACK_RSPEC_SUITE_REPORT_PATH}" "${KNAPSACK_REPORT_PATH}"
if [[ -z "${KNAPSACK_TEST_FILE_PATTERN}" ]]; then
pattern=$(ruby -r./tooling/quality/test_level.rb -e "puts Quality::TestLevel.new(${spec_folder_prefixes}).pattern(:${test_level})")
pattern=$(ruby -r./tooling/quality/test_level.rb -e "puts Quality::TestLevel.new(%(${spec_folder_prefix})).pattern(:${test_level})")
export KNAPSACK_TEST_FILE_PATTERN="${pattern}"
fi
......
......@@ -63,14 +63,7 @@ RSpec.describe Quality::TestLevel do
context 'with a prefix' do
it 'returns a pattern' do
expect(described_class.new('ee/').pattern(:system))
.to eq("{ee/}spec/{features}{,/**/}*_spec.rb")
end
end
context 'with several prefixes' do
it 'returns a pattern' do
expect(described_class.new(['', 'ee/', 'jh/']).pattern(:system))
.to eq("{,ee/,jh/}spec/{features}{,/**/}*_spec.rb")
.to eq("ee/spec/{features}{,/**/}*_spec.rb")
end
end
......@@ -145,14 +138,7 @@ RSpec.describe Quality::TestLevel do
context 'with a prefix' do
it 'returns a regexp' do
expect(described_class.new('ee/').regexp(:system))
.to eq(%r{(ee/)spec/(features)})
end
end
context 'with several prefixes' do
it 'returns a regexp' do
expect(described_class.new(['', 'ee/', 'jh/']).regexp(:system))
.to eq(%r{(|ee/|jh/)spec/(features)})
.to eq(%r{ee/spec/(features)})
end
end
......
......@@ -60,20 +60,20 @@ module Quality
system: ['features']
}.freeze
attr_reader :prefixes
attr_reader :prefix
def initialize(prefixes = nil)
@prefixes = Array(prefixes)
def initialize(prefix = nil)
@prefix = prefix
@patterns = {}
@regexps = {}
end
def pattern(level)
@patterns[level] ||= "#{prefixes_for_pattern}spec/#{folders_pattern(level)}{,/**/}*#{suffix(level)}"
@patterns[level] ||= "#{prefix}spec/#{folders_pattern(level)}{,/**/}*#{suffix(level)}"
end
def regexp(level)
@regexps[level] ||= Regexp.new("#{prefixes_for_regex}spec/#{folders_regex(level)}").freeze
@regexps[level] ||= Regexp.new("#{prefix}spec/#{folders_regex(level)}").freeze
end
def level_for(file_path)
......@@ -102,20 +102,6 @@ module Quality
private
def prefixes_for_pattern
return '' if prefixes.empty?
"{#{prefixes.join(',')}}"
end
def prefixes_for_regex
return '' if prefixes.empty?
regex_prefix = prefixes.map(&Regexp.method(:escape)).join('|')
"(#{regex_prefix})"
end
def suffix(level)
case level
when :frontend_fixture
......
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