Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cfe311c6
Commit
cfe311c6
authored
Aug 26, 2021
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the condition to retrieve test metadata to be opt-in
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
c4753f55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
scripts/rspec_helpers.sh
scripts/rspec_helpers.sh
+7
-7
No files found.
scripts/rspec_helpers.sh
View file @
cfe311c6
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
function
retrieve_tests_metadata
()
{
function
retrieve_tests_metadata
()
{
mkdir
-p
$(
dirname
"
$KNAPSACK_RSPEC_SUITE_REPORT_PATH
"
)
$(
dirname
"
$FLAKY_RSPEC_SUITE_REPORT_PATH
"
)
rspec_profiling/
mkdir
-p
$(
dirname
"
$KNAPSACK_RSPEC_SUITE_REPORT_PATH
"
)
$(
dirname
"
$FLAKY_RSPEC_SUITE_REPORT_PATH
"
)
rspec_profiling/
if
[[
-
z
"
${
RETRIEVE_TESTS_METADATA_FROM_ARTIFACT
S
}
"
]]
;
then
if
[[
-
n
"
${
RETRIEVE_TESTS_METADATA_FROM_PAGE
S
}
"
]]
;
then
if
[[
!
-f
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
]]
;
then
if
[[
!
-f
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
]]
;
then
curl
--location
-o
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
"https://gitlab-org.gitlab.io/gitlab/
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
||
echo
"{}"
>
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
curl
--location
-o
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
"https://gitlab-org.gitlab.io/gitlab/
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
||
echo
"{}"
>
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
fi
fi
...
@@ -19,14 +19,14 @@ function retrieve_tests_metadata() {
...
@@ -19,14 +19,14 @@ function retrieve_tests_metadata() {
local
test_metadata_job_id
local
test_metadata_job_id
# Ruby
# Ruby
test_metadata_job_id
=
$(
scripts/api/get_job_id.rb
--project
"
${
project_path
}
"
-q
"status=success"
-q
"ref=
${
artifact_branch
}
"
-q
"username=gitlab-bot"
-Q
"scope=success"
--job-name
"update-tests-metadata"
)
test_metadata_job_id
=
$(
scripts/api/get_job_id.rb
--
endpoint
"https://gitlab.com/api/v4"
--
project
"
${
project_path
}
"
-q
"status=success"
-q
"ref=
${
artifact_branch
}
"
-q
"username=gitlab-bot"
-Q
"scope=success"
--job-name
"update-tests-metadata"
)
if
[[
!
-f
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
]]
;
then
if
[[
!
-f
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
]]
;
then
scripts/api/download_job_artifact.rb
--project
"
${
project_path
}
"
--job-id
"
${
test_metadata_job_id
}
"
--artifact-path
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
||
echo
"{}"
>
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
scripts/api/download_job_artifact.rb
--
endpoint
"https://gitlab.com/api/v4"
--
project
"
${
project_path
}
"
--job-id
"
${
test_metadata_job_id
}
"
--artifact-path
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
||
echo
"{}"
>
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
fi
fi
if
[[
!
-f
"
${
FLAKY_RSPEC_SUITE_REPORT_PATH
}
"
]]
;
then
if
[[
!
-f
"
${
FLAKY_RSPEC_SUITE_REPORT_PATH
}
"
]]
;
then
scripts/api/download_job_artifact.rb
--project
"
${
project_path
}
"
--job-id
"
${
test_metadata_job_id
}
"
--artifact-path
"
${
FLAKY_RSPEC_SUITE_REPORT_PATH
}
"
||
echo
"{}"
>
"
${
FLAKY_RSPEC_SUITE_REPORT_PATH
}
"
scripts/api/download_job_artifact.rb
--
endpoint
"https://gitlab.com/api/v4"
--
project
"
${
project_path
}
"
--job-id
"
${
test_metadata_job_id
}
"
--artifact-path
"
${
FLAKY_RSPEC_SUITE_REPORT_PATH
}
"
||
echo
"{}"
>
"
${
FLAKY_RSPEC_SUITE_REPORT_PATH
}
"
fi
fi
fi
fi
}
}
...
@@ -52,7 +52,7 @@ function update_tests_metadata() {
...
@@ -52,7 +52,7 @@ function update_tests_metadata() {
function
retrieve_tests_mapping
()
{
function
retrieve_tests_mapping
()
{
mkdir
-p
$(
dirname
"
$RSPEC_PACKED_TESTS_MAPPING_PATH
"
)
mkdir
-p
$(
dirname
"
$RSPEC_PACKED_TESTS_MAPPING_PATH
"
)
if
[[
-
z
"
${
RETRIEVE_TESTS_METADATA_FROM_ARTIFACT
S
}
"
]]
;
then
if
[[
-
n
"
${
RETRIEVE_TESTS_METADATA_FROM_PAGE
S
}
"
]]
;
then
if
[[
!
-f
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
"
]]
;
then
if
[[
!
-f
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
"
]]
;
then
(
curl
--location
-o
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
"https://gitlab-org.gitlab.io/gitlab/
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
&&
gzip
-d
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
)
||
echo
"{}"
>
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
"
(
curl
--location
-o
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
"https://gitlab-org.gitlab.io/gitlab/
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
&&
gzip
-d
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
)
||
echo
"{}"
>
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
"
fi
fi
...
@@ -63,10 +63,10 @@ function retrieve_tests_mapping() {
...
@@ -63,10 +63,10 @@ function retrieve_tests_mapping() {
local
artifact_branch
=
"master"
local
artifact_branch
=
"master"
local
test_metadata_with_mapping_job_id
local
test_metadata_with_mapping_job_id
test_metadata_with_mapping_job_id
=
$(
scripts/api/get_job_id.rb
--project
"
${
project_path
}
"
-q
"status=success"
-q
"ref=
${
artifact_branch
}
"
-q
"username=gitlab-bot"
-Q
"scope=success"
--job-name
"update-tests-metadata"
--artifact-path
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
)
test_metadata_with_mapping_job_id
=
$(
scripts/api/get_job_id.rb
--
endpoint
"https://gitlab.com/api/v4"
--
project
"
${
project_path
}
"
-q
"status=success"
-q
"ref=
${
artifact_branch
}
"
-q
"username=gitlab-bot"
-Q
"scope=success"
--job-name
"update-tests-metadata"
--artifact-path
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
)
if
[[
!
-f
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
"
]]
;
then
if
[[
!
-f
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
"
]]
;
then
(
scripts/api/download_job_artifact.rb
--project
"
${
project_path
}
"
--job-id
"
${
test_metadata_with_mapping_job_id
}
"
--artifact-path
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
&&
gzip
-d
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
)
||
echo
"{}"
>
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
"
(
scripts/api/download_job_artifact.rb
--
endpoint
"https://gitlab.com/api/v4"
--
project
"
${
project_path
}
"
--job-id
"
${
test_metadata_with_mapping_job_id
}
"
--artifact-path
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
&&
gzip
-d
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
.gz"
)
||
echo
"{}"
>
"
${
RSPEC_PACKED_TESTS_MAPPING_PATH
}
"
fi
fi
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment