diff --git a/.circleci/config.yml b/.circleci/config.yml index f26c65aa94e..82880900eec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/bin/build-ci b/bin/build-ci index 3ae555db233..650113d8611 100755 --- a/bin/build-ci +++ b/bin/build-ci @@ -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)