Upgrade FSC to allow list-child-specs option

closes OUT-4802
flag=none

Test-plan:
- test with a custom_reports PS referencing this
- see comments for expectations of FSC re-runs, compare against
  actual

Change-Id: I94ead7b61e37512231b558b16b57a8bfb2cff4c8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276101
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
This commit is contained in:
Brian Watson 2021-10-15 14:24:52 -06:00
parent faec9490aa
commit 8a6e5e5e3e
3 changed files with 2 additions and 33 deletions

View File

@ -63,7 +63,7 @@ group :test do
gem 'parallel_tests'
gem 'rspecq', github: 'kyler-instructure/rspecq', ref: 'a49343fa7eab3329cd5dd86d059b33fc6fee0ce3'
gem 'flakey_spec_catcher', require: false
gem 'flakey_spec_catcher', '~> 0.11.2', require: false
gem 'factory_bot', '6.1.0', require: false
gem 'rspec_junit_formatter', require: false
# axe-core* versions at or above 4.2 have difficulties with iframes. Keep these at 4.1.0 until fixes are investigated

View File

@ -73,7 +73,7 @@ def computeTestCount() {
--env FSC_IGNORE_FILES \
-w=$DOCKER_WORKDIR \
$PATCHSET_TAG \
bash -c "flakey_spec_catcher --use-parent --dry-run-quiet > $DOCKER_WORKDIR/tmp/test_list"
bash -c "flakey_spec_catcher --use-parent --list-child-specs --dry-run-quiet > $DOCKER_WORKDIR/tmp/test_list"
'''
changedTests = readFile("$env.LOCAL_WORKDIR/tmp/test_list").trim()
@ -91,24 +91,6 @@ def computeTestCount() {
"$DOCKER_WORKDIR/$changedTest"
}
sh """
docker-compose run --rm -v \$(pwd)/\$LOCAL_WORKDIR/tmp:\$DOCKER_WORKDIR/tmp \
canvas \
bash -c "bundle exec rspec --dry-run ${changedTestsArr.join(' ')} --require ./build/new-jenkins/rspec_location.rb --format RSpecLocationFormatter --out ${env.DOCKER_WORKDIR}/tmp/test_list_split"
"""
sh "sed -i '/shared_examples/d' $env.LOCAL_WORKDIR/tmp/test_list_split"
changedTests = readFile("$env.LOCAL_WORKDIR/tmp/test_list_split").trim()
changedTestsArr = changedTests.split('\n')
echo "raw result from splitter: \n====\n$changedTests\n===="
if (changedTests.length() == 0) {
echo 'no tests found to execute'
return
}
def testCount = changedTestsArr.size()
def weightedValues = changedTestsArr.collect { changedTest ->
changedTest.contains('selenium') ? env.SELENIUM_RATIO.toInteger() : 1

View File

@ -1,13 +0,0 @@
# frozen_string_literal: true
class RSpecLocationFormatter
RSpec::Core::Formatters.register self, :example_started
def initialize(output)
@output = output
end
def example_started(notification)
@output << notification.example.location << "\n"
end
end