Skip to content

Commit

Permalink
Run each subframework's specs separately
Browse files Browse the repository at this point in the history
Make it easier to see the error in the RSpec report when running
multiple subframeworks in the same job. Previously it required
scrolling inside a long output.
  • Loading branch information
elia committed Jan 5, 2024
1 parent 2b28f94 commit 0b9ca18
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
19 changes: 17 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,23 @@ commands:
test:
steps:
- run:
name: Run Tests
command: ./bin/build-ci
name: "Run Admin Tests"
command: ./bin/build-ci admin
- run:
name: "Run Api Tests"
command: ./bin/build-ci api
- run:
name: "Run Backend Tests"
command: ./bin/build-ci backend
- run:
name: "Run Backend JS Tests"
command: ./bin/build-ci "backend JS"
- run:
name: "Run Core Tests"
command: ./bin/build-ci core
- run:
name: "Run Sample Tests"
command: ./bin/build-ci sample

- store_artifacts:
path: /tmp/test-artifacts
Expand Down
15 changes: 11 additions & 4 deletions bin/build-ci
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,22 @@ class Project
end
end

if ARGV.first # Run a single project
projects = Project.all.select { _1.name == ARGV.first }
elsif ENV['CIRCLE_NODE_INDEX'] # Run projects on a CI node

if ENV['CIRCLE_NODE_INDEX'] # Run projects on a CI node
projects = Project.weighted_projects(
node_total: Integer(ENV.fetch('CIRCLE_NODE_TOTAL', 1)),
node_index: Integer(ENV.fetch('CIRCLE_NODE_INDEX', 0)),
)
else # Run all projects
else
projects = Project.all
end

# Run a single project if requested
projects.select! { _1.title == ARGV.first } if ARGV.first

if projects.empty?
warn("No projects to run")
exit 0
end

exit Project.run(projects)

0 comments on commit 0b9ca18

Please sign in to comment.