Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab
Commits
6922bcab
Commit
6922bcab
authored
2 years ago
by
Mark Lapierre
Committed by
Tiffany Rea
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fetch groups without projects in QA tests
parent
7adcaa9b
No related branches found
No related tags found
1 merge request
!93512
Fetch groups without projects in QA tests
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
qa/qa/resource/api_fabricator.rb
+18
-1
18 additions, 1 deletion
qa/qa/resource/api_fabricator.rb
qa/qa/resource/group.rb
+7
-0
7 additions, 0 deletions
qa/qa/resource/group.rb
qa/qa/resource/sandbox.rb
+7
-0
7 additions, 0 deletions
qa/qa/resource/sandbox.rb
with
32 additions
and
1 deletion
qa/qa/resource/api_fabricator.rb
+
18
−
1
View file @
6922bcab
...
...
@@ -74,6 +74,13 @@ def exists?
response
.
code
==
HTTP_STATUS_OK
end
# Parameters included in the query URL
#
# @return [Hash]
def
query_parameters
@query_parameters
||=
{}
end
private
def
resource_web_url
(
resource
)
...
...
@@ -87,7 +94,8 @@ def api_get
end
def
api_get_from
(
get_path
)
request
=
Runtime
::
API
::
Request
.
new
(
api_client
,
get_path
)
path
=
"
#{
get_path
}#{
query_parameters_to_string
}
"
request
=
Runtime
::
API
::
Request
.
new
(
api_client
,
path
)
response
=
get
(
request
.
url
)
if
response
.
code
==
HTTP_STATUS_SERVER_ERROR
...
...
@@ -101,6 +109,15 @@ def api_get_from(get_path)
response
end
# Query parameters formatted as `?key1=value1&key2=value2...`
#
# @return [String]
def
query_parameters_to_string
query_parameters
.
each_with_object
([])
do
|
(
k
,
v
),
arr
|
arr
<<
"
#{
k
}
=
#{
v
}
"
end
.
join
(
'&'
).
prepend
(
'?'
).
chomp
(
'?'
)
# prepend `?` unless the string is blank
end
def
api_post
process_api_response
(
api_post_to
(
api_post_path
,
api_post_body
))
end
...
...
This diff is collapsed.
Click to expand it.
qa/qa/resource/group.rb
+
7
−
0
View file @
6922bcab
...
...
@@ -61,6 +61,13 @@ def api_get_path
"/groups/
#{
CGI
.
escape
(
determine_full_path
)
}
"
end
# Parameters included in the query URL
#
# @return [Hash]
def
query_parameters
super
.
merge
({
with_projects:
false
})
end
def
api_post_body
{
parent_id:
sandbox
.
id
,
...
...
This diff is collapsed.
Click to expand it.
qa/qa/resource/sandbox.rb
+
7
−
0
View file @
6922bcab
...
...
@@ -57,6 +57,13 @@ def api_get_path
"/groups/
#{
path
}
"
end
# Parameters included in the query URL
#
# @return [Hash]
def
query_parameters
super
.
merge
({
with_projects:
false
})
end
def
api_post_body
{
path:
path
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment