Skip to content

Commit

Permalink
Run the PartialTest on a dedicated CI node (#1541)
Browse files Browse the repository at this point in the history
* Run the PartialTest on a dedicated CI node

Previously every node that ran _any_ super scaffolding test would also run
the super scaffolding test for `PartialTest`.

This PR makes it so that we run that test on a dedicated node, and all
the other nodes won't run it.

* Need to keep that

* consolidate some tests onto the same CI node
  • Loading branch information
jagthedrummer authored Jun 14, 2024
1 parent f5fc6c2 commit e26545d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 30 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/_run_super_scaffolding_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# For super scaffolding tests we need to have exactly 7 runners.
ci_runners: [TestSite, Project, 'Project::Step', Insight, 'Personality::Disposition', 'Personality::Observation', TestFile]
# For super scaffolding tests we need to have exactly 5 runners.
ci_runners: ["TestSite, Project", "Project::Step, Insight", "Personality::Disposition, Personality::Observation", "TestFile, PartialTest", Webhook]
services:
postgres:
image: postgres:11-alpine
Expand Down Expand Up @@ -131,7 +131,12 @@ jobs:
CIRCLE_NODE_INDEX: ${{ strategy.job-index }}

- name: 'Run Super Scaffolding Test'
run: bin/rails test test/system/super_scaffolding/ test/controllers/webhooks/incoming/some_provider_webhooks_controller_test.rb
run: bin/rails test test/system/super_scaffolding/
working-directory: tmp/starter

- name: 'Run Super Scaffolding Webhook Test'
run: bin/rails test test/controllers/webhooks/incoming/some_provider_webhooks_controller_test.rb
if: ${{ strategy.job-index == 5 }}
working-directory: tmp/starter

- name: Test Summary
Expand Down
64 changes: 37 additions & 27 deletions test/bin/setup-super-scaffolding-system-test
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ else
echo "Skipping \`TestSite\` and \`TestPage\` on this CI node."
fi

if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "1" ]; then
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "0" ]; then
rails g super_scaffold Project Team name:text_field description:trix_editor --navbar="ti-layout"
rails g super_scaffold Projects::Deliverable Project,Team name:text_field description:trix_editor

Expand All @@ -35,21 +35,21 @@ else
echo "Skipping \`Project\` and \`Projects::Deliverable\` on this CI node."
fi

if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "2" ]; then
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "1" ]; then
rails g super_scaffold Projects::Step Team name:text_field description:trix_editor --navbar="ti-world"
rails g super_scaffold Objective Projects::Step,Team name:text_field description:trix_editor
else
echo "Skipping \`Projects::Step\` and \`Objective\` on this CI node."
fi

if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "3" ]; then
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "1" ]; then
rails g super_scaffold Insight Team name:text_field description:trix_editor --navbar="ti-world"
rails g super_scaffold Personality::CharacterTrait Insight,Team name:text_field description:trix_editor
else
echo "Skipping \`Insight\` and \`Personality::CharacterTrait\` on this CI node."
fi

if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "4" ]; then
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "2" ]; then
rails g super_scaffold Personality::Disposition Team name:text_field description:trix_editor --navbar="ti-world"
rails g super_scaffold Personality::Note Personality::Disposition,Team name:text_field description:trix_editor

Expand All @@ -65,7 +65,7 @@ else
echo "Skipping \`Personality::Disposition\` and \`Personality::Note\` on this CI node."
fi

if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "5" ]; then
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "2" ]; then
rails g super_scaffold Personality::Observation Team name:text_field description:trix_editor --navbar="ti-world"
rails g super_scaffold Personality::Reactions::Response Personality::Observation,Team name:text_field description:trix_editor
if [[ "$OSTYPE" == "darwin"* ]]; then
Expand All @@ -77,33 +77,43 @@ else
echo "Skipping \`Personality::Observation\` and \`Personality::Reactions::Response\` on this CI node."
fi

if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "6" ]; then
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "3" ]; then
rails g super_scaffold TestFile Team name:text_field foo:file_field bars:file_field{multiple} --navbar="ti-tag"
rails g super_scaffold ColorPicker Team color_picker_value:color_picker --navbar="ti-tag"
else
echo "Skipping \`TestFile\` and \`ColorPicker\` on this CI node."
fi

# TODO: Generate these in parallel.
rails g super_scaffold PartialTest Team \
text_field_test:text_field \
boolean_test:boolean \
single_button_test:buttons \
multiple_buttons_test:buttons{multiple} \
date_test:date_field\
date_time_test:date_and_time_field \
file_test:file_field \
option_test:options \
multiple_options_test:options{multiple} \
password_test:password_field \
phone_field_test:phone_field \
super_select_test:super_select \
multiple_super_select_test:super_select{multiple} \
number_field_test:number_field \
text_area_test:text_area \
address_test:address_field --navbar="ti-layout"

# The test for this webhook is run inline in .circleci/config.yml.
rails g super_scaffold:incoming_webhooks SomeProvider

if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "3" ]; then
# TODO: Generate these in parallel.
rails g super_scaffold PartialTest Team \
text_field_test:text_field \
boolean_test:boolean \
single_button_test:buttons \
multiple_buttons_test:buttons{multiple} \
date_test:date_field\
date_time_test:date_and_time_field \
file_test:file_field \
option_test:options \
multiple_options_test:options{multiple} \
password_test:password_field \
phone_field_test:phone_field \
super_select_test:super_select \
multiple_super_select_test:super_select{multiple} \
number_field_test:number_field \
text_area_test:text_area \
address_test:address_field --navbar="ti-layout"
else
echo "Skipping \`PartialTest\` on this CI node."
fi


# The test for this webhook is run inline in .github/workflows/_run_super_scaffolding_tests.yml
if [ -z "${CIRCLE_NODE_INDEX}" ] || [ "${CIRCLE_NODE_INDEX}" == "4" ]; then
rails g super_scaffold:incoming_webhooks SomeProvider
else
echo "Skipping \`Webhok\` on this CI node."
fi

bundle exec spring rake db:schema:load db:migrate db:test:prepare

0 comments on commit e26545d

Please sign in to comment.