Unverified Commit bac89d77 authored by John Skarbek's avatar John Skarbek Committed by John Skarbek

betterize our testing

parent 5db03926
......@@ -19,11 +19,11 @@ namespace :auto_deploy do
versions = {}
count = 0
ReleaseTools::GitlabClient.branches(ReleaseTools::Project::GitlabEe.path).auto_paginate.each do |branch|
if branch.name =~ /^(\d+-\d+)-auto-deploy.*$/
if branch.name =~ /^(\d+-\d+)-auto-deploy-\d+-ee$/
#binding.pry
# convert the version to version used for picking
branch_name = branch.name
version = branch.name.match(/^(\d+-\d+)-auto-deploy.*$/)[1].gsub('-', '.')
version = branch.name.match(/^(\d+-\d+)-auto-deploy-\d+-ee$/)[1].gsub('-', '.')
versions.merge!(branch_name => version)
count += 1
end
......@@ -31,7 +31,6 @@ namespace :auto_deploy do
puts count
puts versions.count
versions.each do |branch_name, version|
icon = ->(result) { result.success? ? "✓" : "✗" }
version = ReleaseTools::Version.new(version).to_ee
puts "--> Picking for #{version}..."
results = ReleaseTools::CherryPick::Service
......@@ -41,7 +40,7 @@ namespace :auto_deploy do
binding.pry
results.each do |result|
$stdout.puts " #{icon.call(result)} #{result.url}"
puts result.inspect
end
end
......
......@@ -28,6 +28,18 @@ module ReleaseTools
update_auto_deploy_ci
end
def filter_branches
versions = {}
ReleaseTools::GitlabClient.branches(ReleaseTools::Project::GitlabEe.path).auto_paginate.each do |branch|
next unless branch.name.match?(/^(\d+-\d+)-auto-deploy-\d+-ee$/)
branch_name = branch.name
version = branch.name.match(/^(\d+-\d+)-auto-deploy-\d+-ee$/)[1].tr('-', '.')
versions.merge!(branch_name => version)
end
versions
end
private
def update_auto_deploy_ci
......
This diff is collapsed.
......@@ -51,3 +51,18 @@ describe ReleaseTools::Services::AutoDeployBranchService do
end
end
end
describe ReleaseTools::Services::AutoDeployBranchService do
describe '#filter_branches' do
subject(:service) do
VCR.use_cassette('branches/list') do
wut = described_class.new(1)
wut.filter_branches
end
end
it 'finds all auto-deploy branches' do
expect(subject).to be_nil
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