Skip to content

Commit

Permalink
add mapping wf test
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed May 19, 2023
1 parent fd90364 commit 3a3408f
Show file tree
Hide file tree
Showing 2 changed files with 1,755 additions and 0 deletions.
25 changes: 25 additions & 0 deletions bin/list-workflows-with-tests.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'json'
require 'yaml'

Dir.glob('./topics/**/*.ga') do |path|
folder = File.dirname(path)
basename = File.basename(path).gsub(/.ga$/, '')
possible_tests = Dir.glob("#{folder}/#{basename}*ym*")
possible_tests = possible_tests.grep(/#{basename}[_-]tests?.ya?ml/)

possible_tests.each do |possib|
if ! possib.match(/-test.yml/)
puts "Renaming #{possib}"
# Rename the file to have the correct extension
File.rename(possib, possib.gsub(/[_-]tests?.ya?ml$/, '-test.yml'))
end
end

if ! possible_tests.empty?
puts "#{path}"
end

end
Loading

0 comments on commit 3a3408f

Please sign in to comment.