mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
Adds exclude_from_ci support to unit tests, again (#96545)
## About The Pull Request When I was working on #96368 I was unaware of the following: <img width="584" height="294" alt="image" src="https://github.com/user-attachments/assets/a6578a46-04e8-4316-a2d6-5aaadffbdea6" /> So I'm fixing it. ## Why It's Good For The Game Sorry downstreams ## Changelog No user facing changes
This commit is contained in:
@@ -52,6 +52,7 @@ jobs:
|
||||
uses: ./.github/workflows/perform_regular_version_tests.yml
|
||||
with:
|
||||
maps: ${{ needs.collect_data.outputs.maps }}
|
||||
map_config: ${{ needs.collect_data.outputs.map_config }}
|
||||
max_required_byond_client: ${{ needs.collect_data.outputs.max_required_byond_client }}
|
||||
|
||||
run_alternate_tests:
|
||||
|
||||
@@ -6,6 +6,9 @@ on:
|
||||
maps:
|
||||
description: "The maps that were found"
|
||||
value: ${{ jobs.collect_data.outputs.maps }}
|
||||
map_config:
|
||||
description: "The map config file to use"
|
||||
value: ${{ jobs.collect_data.outputs.map_config }}
|
||||
alternate_tests:
|
||||
description: "The alternate tests that were found"
|
||||
value: ${{ jobs.collect_data.outputs.alternate_tests }}
|
||||
@@ -22,6 +25,7 @@ jobs:
|
||||
timeout-minutes: 5
|
||||
outputs:
|
||||
maps: ${{ steps.map_finder.outputs.maps }}
|
||||
map_config: ${{ steps.map_finder.outputs.map_config }}
|
||||
alternate_tests: ${{ steps.alternate_test_finder.outputs.alternate_tests }}
|
||||
max_required_byond_client: ${{ steps.max_required_byond_client.outputs.max_required_byond_client }}
|
||||
required_build_versions: ${{ steps.setup_required_build_versions.outputs.required_build_versions }}
|
||||
@@ -32,16 +36,27 @@ jobs:
|
||||
id: map_finder
|
||||
run: |
|
||||
> maps_output.txt
|
||||
> map_configs.txt
|
||||
|
||||
for file in _maps/*.json; do
|
||||
if ! jq -e '.exclude_from_ci == true' "$file" >/dev/null 2>&1; then
|
||||
echo "\"$(basename "$file" .json)\"" >> maps_output.txt
|
||||
map_name=$(basename "$file" .json)
|
||||
|
||||
echo "\"$map_name\"" >> maps_output.txt
|
||||
echo "map $map_name" >> map_configs.txt
|
||||
echo "endmap" >> map_configs.txt
|
||||
else
|
||||
echo "Excluded: $file"
|
||||
fi
|
||||
done
|
||||
|
||||
map_list=$(paste -sd, maps_output.txt)
|
||||
echo "Maps: $map_list"
|
||||
echo "maps={\"paths\":[$map_list]}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
echo "map_config<<EOF" >> "$GITHUB_OUTPUT"
|
||||
cat map_configs.txt >> "$GITHUB_OUTPUT"
|
||||
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||
- name: Find Alternate Tests
|
||||
id: alternate_test_finder
|
||||
run: |
|
||||
|
||||
@@ -6,6 +6,9 @@ on:
|
||||
maps:
|
||||
required: true
|
||||
type: string
|
||||
map_config:
|
||||
required: true
|
||||
type: string
|
||||
max_required_byond_client:
|
||||
required: true
|
||||
type: string
|
||||
@@ -21,4 +24,5 @@ jobs:
|
||||
|
||||
with:
|
||||
map: ${{ matrix.map }}
|
||||
map_config: ${{ inputs.map_config }}
|
||||
max_required_byond_client: ${{ inputs.max_required_byond_client }}
|
||||
|
||||
@@ -8,6 +8,9 @@ on:
|
||||
map:
|
||||
required: true
|
||||
type: string
|
||||
map_config:
|
||||
required: false
|
||||
type: string
|
||||
major:
|
||||
required: false
|
||||
type: string
|
||||
@@ -60,7 +63,7 @@ jobs:
|
||||
id: run_tests
|
||||
run: |
|
||||
source $HOME/BYOND/byond/bin/byondsetup
|
||||
bash tools/ci/run_server.sh ${{ inputs.map }}
|
||||
bash tools/ci/run_server.sh "${{ inputs.map }}" "${{ inputs.map_config }}"
|
||||
- name: Upload screenshot tests
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
|
||||
@@ -20,14 +20,13 @@ GLOBAL_VAR_INIT(running_create_and_destroy, FALSE)
|
||||
|
||||
// This code is responsible for splitting up create & destroy across multiple integration tests.
|
||||
var/total_amount_to_check = length(type_paths_to_check)
|
||||
var/runner_count = length(config.maplist)
|
||||
var/runner_count = max(length(config.maplist), 1)
|
||||
|
||||
var/split_up_amount = floor(total_amount_to_check / runner_count)
|
||||
|
||||
var/what_map_index_are_we = 1
|
||||
for(var/map_name, _map_config in config.maplist)
|
||||
var/datum/map_config/map_config = _map_config
|
||||
if(SSmapping.current_map.map_name == map_config.map_name)
|
||||
for(var/map_name in config.maplist)
|
||||
if(SSmapping.current_map.map_name == map_name)
|
||||
break
|
||||
what_map_index_are_we++
|
||||
|
||||
@@ -39,7 +38,7 @@ GLOBAL_VAR_INIT(running_create_and_destroy, FALSE)
|
||||
type_paths_to_check = type_paths_to_check.Copy(start_index, end_index + 1)
|
||||
|
||||
log_world("Running create and destroy on [length(type_paths_to_check)] atoms out of the [total_amount_to_check] total")
|
||||
log_world("([start_index] [type_paths_to_check[1]]) - ([end_index] [type_paths_to_check[length(type_paths_to_check)]])")
|
||||
log_world("([start_index + 1] [type_paths_to_check[1]]) - ([end_index] [type_paths_to_check[length(type_paths_to_check)]])")
|
||||
|
||||
for(var/type_path in type_paths_to_check)
|
||||
if(ispath(type_path, /turf))
|
||||
|
||||
@@ -378,7 +378,7 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests())
|
||||
primary_unit_test_map = map_config
|
||||
if(!LAZYLEN(map_config.skipped_tests) && !found_secondary_unit_test_map)
|
||||
found_secondary_unit_test_map = TRUE
|
||||
if(SSmapping.current_map.map_name == map_config.map_name)
|
||||
if(SSmapping.current_map.map_name == map_name)
|
||||
is_secondary_unit_test_map = TRUE
|
||||
|
||||
var/list/tests_to_run = list()
|
||||
@@ -386,7 +386,10 @@ GLOBAL_VAR_INIT(focused_tests, focused_tests())
|
||||
for (var/datum/unit_test/potential_test as anything in subtypesof(/datum/unit_test))
|
||||
// If the test has [UNIT_TEST_DEBUG_MAP_ONLY] and we aren't the primary unit test map, skip it.
|
||||
// HOWEVER, some unit tests are incompatible with the primary testing map, so we must offload them a secondary one with no blacklisted tests.
|
||||
if((potential_test::test_flags & UNIT_TEST_DEBUG_MAP_ONLY) && !SSmapping.current_map.is_unit_test_map && \
|
||||
// If we didn't find a primary unit test map then we are likely a solo runner.
|
||||
if((potential_test::test_flags & UNIT_TEST_DEBUG_MAP_ONLY) && \
|
||||
!isnull(primary_unit_test_map) && \
|
||||
!SSmapping.current_map.is_unit_test_map && \
|
||||
!(primary_unit_test_map.skipped_tests?.Find(potential_test) && is_secondary_unit_test_map) \
|
||||
)
|
||||
continue
|
||||
|
||||
@@ -15,8 +15,6 @@ Format:
|
||||
webmap_url (link to the a webmap to see the map in the user's browser)
|
||||
endmap
|
||||
|
||||
# When adding or removing maps be sure to also add/remove from ci_config_maps.txt
|
||||
|
||||
# Production-level maps.
|
||||
|
||||
map deltastation
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
map deltastation
|
||||
endmap
|
||||
|
||||
map icebox
|
||||
endmap
|
||||
|
||||
map catwalkstation
|
||||
endmap
|
||||
|
||||
map metastation
|
||||
endmap
|
||||
|
||||
map tramstation
|
||||
endmap
|
||||
|
||||
map nebulastation
|
||||
endmap
|
||||
|
||||
map wawastation
|
||||
endmap
|
||||
|
||||
map gateway_test
|
||||
endmap
|
||||
|
||||
map multiz_debug
|
||||
endmap
|
||||
|
||||
map runtimestation
|
||||
endmap
|
||||
|
||||
map runtimestation_minimal
|
||||
endmap
|
||||
@@ -2,6 +2,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
MAP=$1
|
||||
MAP_CONFIG=${2:-""}
|
||||
|
||||
echo Testing $MAP
|
||||
|
||||
@@ -11,7 +12,9 @@ mkdir -p ci_test/data
|
||||
|
||||
#test config
|
||||
cp tools/ci/ci_config.txt ci_test/config/config.txt
|
||||
cp tools/ci/ci_config_maps.txt ci_test/config/maps.txt
|
||||
if [ -n "$MAP_CONFIG" ]; then
|
||||
echo "$MAP_CONFIG" > ci_test/config/maps.txt
|
||||
fi
|
||||
|
||||
#set the map
|
||||
cp _maps/$MAP.json ci_test/data/next_map.json
|
||||
|
||||
Reference in New Issue
Block a user