Skip to content

Commit

Permalink
port away from ci-tooling
Browse files Browse the repository at this point in the history
this has been deprecated since 2014 and nothing was done about it so.
here I am jumping in the deep end.

this may well blow up since even newer programs have been using
ci-tooling or worse lived in ci-tooling while using libs from the main
dir. so we basically have to rely on test coverage for this but that too
doesn't exist for many of the programs, libraries meanwhile are fairly
ok so I have no worries there.

on the plus side fixing regressions should be easy enough as it simply
means changing the relative reference so it is correct for the new
structure and that is trivial because everything is where it was, the
ci-tooling/ subdir has simply been folded up.

to not have to regenerate all jenkins jobs we still have compatibility
symlinks for the programs. libraries are intentionally excluded because
they can cause require loops between a symlink library and its real
file, also double requires - ruby doesn't consider the symlink and the
real file the same path so they always get required even when require
usually would prevent double-loading the same file
  • Loading branch information
hsitter committed Feb 5, 2021
1 parent de754dd commit 2d5fb19
Show file tree
Hide file tree
Showing 1,279 changed files with 320 additions and 7,102 deletions.
52 changes: 10 additions & 42 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,73 +37,41 @@ require_relative 'lib/rake/bundle'

BIN_DIRS = %w[
.
ci-tooling
overlay-bin
].freeze

SOURCE_DIRS = %w[
ci-tooling/ci
ci-tooling/dci
ci-tooling/lib
ci-tooling/nci
ci
dci
jenkins-jobs
lib
nci
mgmt
overlay-bin
overlay-bin/lib
xci
].freeze

desc 'run all unit tests'
task :test do
# We separately run pangea (host) and ci-tooling (host/container) tooling
# as former is not particularly suited to parallel exceution due to it
# using a live docker, so reentrancy and so forth is a concern.
# Latter however is perfectly suited and is run in parallel to speed up
# test execution.
Rake::TestTask.new do |t|
t.ruby_opts << "-r#{File.expand_path(__dir__)}/test/helper.rb"
# Parsing happens in a separate task because failure there outranks everything
list =FileList['test/test_*.rb'].exclude('test/test_parse.rb')
t.test_files = list
t.options = "--stop-on-failure --verbose=v"
t.verbose = false
end
task :test => 'ci:setup:testunit'
task :test => :test_pangea
task :test => :test_ci_parallel
task :test => :test_pangea_parse
CLEAN << 'coverage' # Created through helper's simplecov
CLEAN << 'test/reports'

desc 'run ci-tooling tests (this runs in sync via TestTask)'
Rake::TestTask.new(:test_ci) do |t|
t.ruby_opts << "-r#{File.expand_path(__dir__)}/test/helper.rb"
t.test_files = FileList['ci-tooling/test/test_*.rb']
t.verbose = true
end

desc 'run ci-tooling tests in parallel'
task :test_ci_parallel do
ENV['PARALLEL_TESTS_EXECUTABLE'] = "ruby -r#{__dir__}/test/helper.rb"
opts = []
opts << '--serialize-stdout'
opts << '--combine-stderr'
opts << '--nice'
opts << '--verbose'
test_files = FileList['ci-tooling/test/test_*.rb']
sh('parallel_test', *opts, *test_files)
end
task :test_ci_parallel => 'ci:setup:testunit'

desc 'run pangea-tooling (parse) test'
Rake::TestTask.new(:test_pangea_parse) do |t|
# Parse takes forever, so we run it concurrent to the other tests.
t.test_files = FileList['test/test_parse.rb']
t.verbose = true
end

desc 'run pangea-tooling tests'
Rake::TestTask.new(:test_pangea_core) do |t|
t.ruby_opts << "-r#{File.expand_path(__dir__)}/test/helper.rb"
t.test_files = FileList['test/test_*.rb'].exclude('test/test_parse.rb')
t.verbose = true
end
multitask :test_pangea => [:test_pangea_parse, :test_pangea_core]

desc 'generate line count report'
task :cloc do
system("cloc --by-file --xml --out=cloc.xml #{SOURCE_DIRS.join(' ')}")
Expand Down
1 change: 0 additions & 1 deletion ci

This file was deleted.

1 change: 1 addition & 0 deletions ci-tooling/ci
1 change: 1 addition & 0 deletions ci-tooling/dci
1 change: 1 addition & 0 deletions ci-tooling/nci
3 changes: 0 additions & 3 deletions ci-tooling/test/.rubocop.yml

This file was deleted.

11 changes: 0 additions & 11 deletions ci-tooling/test/data/fake_data/kci.yaml

This file was deleted.

1 change: 0 additions & 1 deletion ci-tooling/test/data/test_ci_orig_source_builder/http

This file was deleted.

1 change: 0 additions & 1 deletion ci-tooling/test/data/test_kci_builder/test_puts_log/cmake

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2d5fb19

Please sign in to comment.