Commit 4d2f43fb authored by Tiffany Rea's avatar Tiffany Rea Committed by Dan Davison

Fix for clone using deploy key spec

- Add locator for Retry button in sidebar.vue
- Add retry! logic for a pipeline job
- Add remove variable logic for CI/CD
- Add CiVariable via API instead of UI in spec
- Make helper method private
- Leave test in quarantine to monitor result in nightly first
- Dequarantine after passing in nightly
parent 0ee27d62
......@@ -119,6 +119,7 @@ export default {
:class="retryButtonClass"
:href="job.retry_path"
data-method="post"
data-qa-selector="retry_button"
rel="nofollow"
>{{ __('Retry') }}</gl-link
>
......
......@@ -13,6 +13,10 @@ module QA::Page
element :pipeline_path
end
view 'app/assets/javascripts/jobs/components/sidebar.vue' do
element :retry_button
end
def successful?(timeout: 60)
raise "Timed out waiting for the build trace to load" unless loaded?
raise "Timed out waiting for the status to be a valid completed state" unless completed?(timeout: timeout)
......@@ -33,6 +37,10 @@ module QA::Page
result
end
def retry!
click_element :retry_button
end
private
def loaded?(wait: 60)
......
......@@ -52,6 +52,14 @@ module QA
end
end
def remove_variable(location: :first)
within('.ci-variable-row-body', match: location) do
find('button.ci-variable-row-remove-button').click
end
save_variables
end
private
def toggle_masked(masked_node, masked)
......
......@@ -46,12 +46,7 @@ module QA
deploy_key_name = "DEPLOY_KEY_#{key.name}_#{key.bits}"
Resource::CiVariable.fabricate_via_browser_ui! do |resource|
resource.project = @project
resource.key = deploy_key_name
resource.value = key.private_key
resource.masked = false
end
make_ci_variable(deploy_key_name, key)
gitlab_ci = <<~YAML
cat-config:
......@@ -90,6 +85,17 @@ module QA
expect(job.output).to include(sha1sum)
end
end
private
def make_ci_variable(key_name, key)
Resource::CiVariable.fabricate_via_api! do |resource|
resource.project = @project
resource.key = key_name
resource.value = key.private_key
resource.masked = false
end
end
end
end
end
......
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