Skip to content

Commit

Permalink
Splits unit tests into MULTIPLE concurrent jobs (#2487)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

See title.

## Why It's Good For The Game

It's a pain to have to wait that long to merge a PR. Like come on.

## Changelog

:cl:
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
MarkSuckerberg authored Dec 12, 2023
1 parent 64c1a18 commit 8127df2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,19 @@ jobs:
run_all_tests:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
name: Integration Tests
strategy:
fail-fast: true
matrix:
arg: [
"BASIC_TESTS",
"CREATE_AND_DESTROY_TEST",
"PLANET_GEN_TEST",
"RUIN_PLACEMENT_TEST",
"SHIP_PLACEMENT_TEST"
]
uses: ./.github/workflows/run_integration_tests.yml
with:
arg: ${{ matrix.arg }}

# run_alternate_tests:
# if: "!contains(github.event.head_commit.message, '[ci skip]')"
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/run_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
minor:
required: false
type: string
arg:
required: false
default: ALL_TESTS
type: string
jobs:
run_integration_tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,7 +58,7 @@ jobs:
run: |
bash tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build --ci dm -DCIBUILDING -DANSICOLORS
tools/build/build --ci dm -DCIBUILDING -DANSICOLORS -D${{ inputs.arg }}
- name: Run Tests
run: |
source $HOME/BYOND/byond/bin/byondsetup
Expand Down
9 changes: 9 additions & 0 deletions code/_compile_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#endif // REFERENCE_DOING_IT_LIVE

//#define UNIT_TESTS //Enables unit tests via TEST_RUN_PARAMETER
//#define ALL_TESTS //Enables all tests, including the ones that take a long time to run

#ifndef PRELOAD_RSC //set to:
#define PRELOAD_RSC 2 // 0 to allow using external resources or on-demand behaviour;
Expand Down Expand Up @@ -78,6 +79,14 @@
#define GC_FAILURE_HARD_LOOKUP
#endif

#ifdef ALL_TESTS
#define BASIC_TESTS
#define CREATE_AND_DESTROY_TEST
#define PLANET_GEN_TEST
#define RUIN_PLACEMENT_TEST
#define SHIP_PLACEMENT_TEST
#endif

// A reasonable number of maximum overlays an object needs
// If you think you need more, rethink it
#define MAX_ATOM_OVERLAYS 100
Expand Down
27 changes: 22 additions & 5 deletions code/modules/unit_tests/_unit_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@
#define TEST_OUTPUT_GREEN(text) (text)
#endif

#ifdef BASIC_TESTS

#include "anchored_mobs.dm"
#include "autowiki.dm"
#include "bespoke_id.dm"
#include "binary_insert.dm"
#include "combat.dm"
#include "component_tests.dm"
#include "connect_loc.dm"
#include "create_and_destroy.dm"
#include "biome_lists.dm"
#include "emoting.dm"
#include "keybinding_init.dm"
Expand All @@ -78,7 +79,6 @@
#include "outfit_sanity.dm"
#include "overmap.dm"
#include "pills.dm"
#include "planet_gen.dm"
#include "plantgrowth_tests.dm"
#include "projectiles.dm"
#include "quick_swap_sanity.dm"
Expand All @@ -90,10 +90,8 @@
#include "reagent_names.dm"
#include "reagent_recipe_collisions.dm"
#include "resist.dm"
#include "ruin_placement.dm"
#include "say.dm"
#include "serving_tray.dm"
#include "ship_outpost_placement.dm"
#include "spawn_humans.dm"
#include "species_unique_id.dm"
#include "species_whitelists.dm"
Expand All @@ -103,12 +101,31 @@
#include "supply_pack.dm"
#include "teleporters.dm"
#include "timer_sanity.dm"
#include "unit_test.dm"

#ifdef REFERENCE_TRACKING_DEBUG //Don't try and parse this file if ref tracking isn't turned on. IE: don't parse ref tracking please mr linter
#include "find_reference_sanity.dm"
#endif

#endif //BASIC_TESTS

#ifdef CREATE_AND_DESTROY_TEST
#include "create_and_destroy.dm"
#endif //CREATE_AND_DESTROY_TEST

#ifdef PLANET_GEN_TEST
#include "planet_gen.dm"
#endif //PLANET_GEN

#ifdef RUIN_PLACEMENT_TEST
#include "ruin_placement.dm"
#endif //RUIN_PLACEMENT_TEST

#ifdef SHIP_PLACEMENT_TEST
#include "ship_outpost_placement.dm"
#endif //SHIP_PLACEMENT_TEST

#include "unit_test.dm"

#undef TEST_ASSERT
#undef TEST_ASSERT_EQUAL
#undef TEST_ASSERT_NOTEQUAL
Expand Down

0 comments on commit 8127df2

Please sign in to comment.