-
Notifications
You must be signed in to change notification settings - Fork 249
Re-enable GitLabPluginTest #2285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
apuig
wants to merge
23
commits into
jenkinsci:master
Choose a base branch
from
apuig:gitlabtests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
bc00df2
Testing re-enable GitLab
apuig 9c2740d
Use the browser earlier to minimize session timeout issues after 10 m…
apuig 372b7b8
Add Docker memory options
apuig f7206ee
Cleanup GitLab container. Increase required memory to 4gb and tune op…
apuig 0caee9f
start docker image before navigating UI
apuig 09d4993
:see_no_evil: no chache, no migrations
apuig 4fa87b5
Keep WebDriver session alive during GitLab startup to prevent timeout
apuig 94971c0
merge testTagDiscovery into testGitLabMultibranchPipeline to reduce t…
apuig 10a3db8
trigger rebuild
apuig 35c2a15
trigger rebuild
apuig e88c8fa
trigger rebuild
apuig 3b81a33
trigger rebuild
apuig b2107eb
add references
apuig 2c2d6db
apply comments:
apuig eb134fe
close stream to console log
apuig 05036a3
apply comments:
apuig d2d332d
Merge branch 'master' into gitlabtests
apuig e80599e
use webdriver to wait for gitlab container
apuig 33c26a8
introduce `toFunction` to workaround checked exceptions in `ignoring`
apuig ee3f364
introduce `createOrGetWithRetry` for better code reuse
apuig f3a16fc
Merge branch 'master' into gitlabtests
apuig b851d4d
use gitlab.rb
apuig 3198be3
reuse container
apuig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 40 additions & 15 deletions
55
...in/resources/org/jenkinsci/test/acceptance/docker/fixtures/GitLabContainer/create_user.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,40 @@ | ||
| input_array = ARGV | ||
|
|
||
| user = User.create(); | ||
| user.name = input_array[0]; | ||
| user.username = input_array[0]; | ||
| user.password = input_array[1]; | ||
| user.confirmed_at = '01/01/1990'; | ||
| user.admin = input_array[3]; | ||
| user.email = input_array[2]; | ||
| user.save!; | ||
|
|
||
| token = user.personal_access_tokens.create(scopes: [:api], name: 'MyToken'); | ||
| token.expires_at='01/01/2024'; | ||
| token.save!; | ||
| puts token.token; | ||
| # frozen_string_literal: true | ||
|
|
||
| # Script to create GitLab user with personal access token | ||
| # Usage: gitlab-rails runner create_user.rb <username> <password> <email> <is_admin> | ||
|
|
||
| username, password, email, is_admin = ARGV | ||
|
|
||
| # Ensure default organization exists | ||
| default_org = Organizations::Organization.find_or_create_by!(name: 'Default', path: 'default') do |org| | ||
| org.description = 'Default organization for test users' | ||
| end | ||
|
|
||
| # Create user with namespace and organization | ||
| user_params = { | ||
| name: username, | ||
| username: username, | ||
| password: password, | ||
| password_confirmation: password, | ||
| email: email, | ||
| admin: is_admin == 'true', | ||
| skip_confirmation: true, | ||
| organization_id: default_org&.id | ||
| }.compact | ||
|
|
||
| result = Users::CreateService.new(nil, user_params).execute | ||
|
|
||
| raise "Failed to create user: #{result.message}" unless result.success? | ||
|
|
||
| user = result.payload[:user] | ||
|
|
||
| raise "Failed to create user. Result: #{result.inspect}" unless user&.persisted? | ||
|
|
||
| # Create personal access token with 1-month expiration | ||
| token = user.personal_access_tokens.create!( | ||
| scopes: [:api, :read_user, :read_api, :read_repository, :write_repository], | ||
| name: 'MyToken', | ||
| expires_at: 30.days.from_now | ||
| ) | ||
|
|
||
| puts token.token |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.