Delta-v/Content.IntegrationTests/Tests
Pieter-Jan Briers b7f297f612 Fix usages of TryIndex() (#39124)
* Fix usages of TryIndex()

Most usages of TryIndex() were using it incorrectly. Checking whether prototype IDs specified in prototypes actually existed before using them. This is not appropriate as it's just hiding bugs that should be getting caught by the YAML linter and other tools. (#39115)

This then resulted in TryIndex() getting modified to log errors (94f98073b0), which is incorrect as it causes false-positive errors in proper uses of the API: external data validation. (#39098)

This commit goes through and checks every call site of TryIndex() to see whether they were correct. Most call sites were replaced with the new Resolve(), which is suitable for these "defensive programming" use cases.

Fixes #39115

Breaking change: while doing this I noticed IdCardComponent and related systems were erroneously using ProtoId<AccessLevelPrototype> for job prototypes. This has been corrected.

* fix tests

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2025-12-29 11:39:03 -06:00
..
Access Access Reader Refactor (#37772) 2025-08-07 00:26:56 +02:00
Actions Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
Administration/Logs Un-revert #26994 2024-04-21 23:37:18 +02:00
Atmos Improve Gas Yaml Serialization (#40070) 2025-12-29 11:39:00 -06:00
Body Revert polymorphed entities before gibbing if revert on death. (#3492) 2025-04-17 11:08:44 +01:00
Buckle Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
Chameleon Cleanup `ChameleonJobLoadoutTest` (#38229) 2025-08-07 02:13:22 +02:00
Chemistry Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
Cleanup Un-revert IPlayerManager refactor (#21244) 2023-10-31 19:00:44 +01:00
Climbing Partial buckling refactor (#29031) 2024-07-25 00:34:37 +02:00
Cloning Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
Commands Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
Construction Don't enqueue construction events without validation (#39869) 2025-11-23 15:22:34 -06:00
Damageable Add test of `StaminaComponent` crit vs animation thresholds (#39249) 2025-11-23 15:22:22 -06:00
Destructible Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
DeviceLinking Fix wrong assert message in DeviceLinkingTest (#35964) 2025-03-23 16:17:17 +00:00
DeviceNetwork upstream merge 27/04/2025 (#3596) 2025-05-06 19:35:03 -04:00
Disposal Add test of disposal unit throw-insert behavior (#39479) 2025-11-23 15:22:32 -06:00
DoAfter Add StorageInteractionTest (#28541) 2024-06-08 20:02:56 +02:00
Doors EVENT BASED WEIGHTLESSNESS (#37971) 2025-11-23 15:22:27 -06:00
Embedding Fix embedded projectile deletion not being tracked by container (#36123) 2025-04-06 20:43:53 +01:00
EncryptionKeys Add StorageInteractionTest (#28541) 2024-06-08 20:02:56 +02:00
Engineering Inflatable Module (#35100) 2025-11-23 15:22:30 -06:00
Explosion Add validation test for `ExplosionPrototype`s (#37621) 2025-08-04 14:54:19 +02:00
Fluids Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
GameObjects/Components Miscellaneous Body Decoupling (#38958) 2025-11-23 15:22:18 -06:00
GameRules Move mind role components to shared (#39606) 2025-11-23 15:22:24 -06:00
Gravity EVENT BASED WEIGHTLESSNESS (#37971) 2025-11-23 15:22:27 -06:00
Guidebook ill take the 3 second guidebook opening thanks 2025-05-21 20:00:11 +01:00
Hands Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
Interaction Add water cooler interaction test (#39612) 2025-12-29 11:39:01 -06:00
Internals Mind Role Entities (#31318) 2024-10-24 00:32:47 +01:00
Lathe Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
Linter Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
Lobby Lobby refactor + species loadouts support (#27576) 2024-05-18 13:55:56 +02:00
Localization Add test that entity prototypes don't use LocIds for name/description (#38234) 2025-08-07 02:13:55 +02:00
Mapping Code Cleanup: Integration Tests (#29584) 2024-08-09 17:26:13 +01:00
Materials Cleanup: Use ``MapSystem.DeleteMap`` instead of ``IMapManager.DeleteMap`` in ``MaterialPrototypeSpawnsStackMaterialTest`` (#35472) 2025-03-01 14:28:21 +00:00
Minds Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
Movement Code Cleanup: Integration Tests (#29584) 2024-08-09 17:26:13 +01:00
NPC Allow the creation of recursive HTNs (#30138) 2024-08-09 18:12:53 +01:00
Networking Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
Nutrition Add water cooler interaction test (#39612) 2025-12-29 11:39:01 -06:00
Nyanotrasen/Oracle fix metempsychosis (#2156) 2024-11-09 10:47:17 +00:00
Payload Trigger Refactor (#39034) 2025-11-23 15:22:15 -06:00
Physics Add test for anchored prototypes (#30526) 2024-08-09 18:15:15 +01:00
Power Add basic test of station initial power supply (#29698) 2025-08-06 22:41:46 +02:00
Preferences Mind Role Entities (#31318) 2024-10-24 00:32:47 +01:00
Procedural Remove obsolete TestPair.Pair (#19496) 2023-08-25 10:56:51 +10:00
PrototypeTests Add PrototypeUploadTest (#28522) 2024-06-06 21:59:49 +02:00
Puller Code Cleanup: Integration Tests (#29584) 2024-08-09 17:26:13 +01:00
Replays Mark all tests that restart rounds as dirty (#21376) 2023-11-12 20:29:56 +01:00
Roles Cleanup: Use ``MapSystem.DeleteMap`` instead of ``IMapManager.DeleteMap`` in ``StartingGearPrototypeStorageTest`` (#35474) 2025-03-01 14:28:21 +00:00
Round Code Cleanup: Integration Tests (#29584) 2024-08-09 17:26:13 +01:00
Serialization Code Cleanup: Integration Tests (#29584) 2024-08-09 17:26:13 +01:00
Shuttle Refactor map loading & saving (#34020) 2025-03-01 13:20:37 +00:00
Sprite port better borgs from frontier (#3110) 2025-03-04 12:10:32 +00:00
Station Move some Station methods into shared (#38976) 2025-11-23 15:22:20 -06:00
Storage upstream merge 27/04/2025 (#3596) 2025-05-06 19:35:03 -04:00
Strip Strip drag drop test (#30754) 2024-08-09 19:01:46 +01:00
Tag Cleans up tag system (#28272) 2024-06-06 21:33:38 +02:00
Tiles Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
Toolshed Toolshed refactor (#33598) 2024-12-21 10:26:06 +00:00
UserInterface refactor: simple radial menu for easier creation (#34639) 2025-04-06 20:52:12 +01:00
Utility Add EntityWhitelistSystem (#27632) 2024-05-07 04:29:05 +02:00
Vending Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
Weldable Add StorageInteractionTest (#28541) 2024-06-08 20:02:56 +02:00
Wires Fix wire layout inheritance. (#26289) 2024-03-24 00:04:51 +01:00
_DV Revert traitor reputation (#3823) 2025-05-22 23:59:12 +01:00
_Impstation/Thaven disable thaven test (#3589) 2025-04-27 03:08:13 +01:00
_Shitmed/Body Shitmed (#869) 2024-12-27 16:47:20 +00:00
CargoTest.cs Remove BodyComponent check from MobPrice test (#39786) 2025-11-23 15:22:29 -06:00
ClickableTest.cs Cleanup more `SpriteComponent` warnings (part 5) (#37590) 2025-08-04 14:33:26 +02:00
ConfigPresetTests.cs Fix ConfigPresetTests.TestLoadAll not handling automatic panic bunker (#23414) 2024-01-26 21:27:08 +01:00
ContainerOcclusionTest.cs Code Cleanup: Integration Tests (#29584) 2024-08-09 17:26:13 +01:00
ContrabandTest.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
DeleteInventoryTest.cs Remove obsolete PoolManager methods (#19499) 2023-08-25 12:13:11 +10:00
DummyIconTest.cs Cleanup 2 `SpriteComponent.GetPrototypeTextures` uses (#38263) 2025-08-07 02:17:47 +02:00
EntityTest.cs Holofan Rebalance (and Standardizing Holoprojectors) (#4734) 2025-12-05 12:56:09 +00:00
FillLevelSpriteTest.cs Add an integration test for solution fill level sprites. (#28564) 2024-06-08 20:14:28 +02:00
FollowerSystemTest.cs Code Cleanup: Integration Tests (#29584) 2024-08-09 17:26:13 +01:00
GravityGridTest.cs EVENT BASED WEIGHTLESSNESS (#37971) 2025-11-23 15:22:27 -06:00
HumanInventoryUniformSlotsTest.cs Cleanup: Use ``MapSystem.DeleteMap`` instead of ``IMapManager.DeleteMap`` in ``HumanInventoryUniformSlotsTest`` (#35469) 2025-03-01 14:28:21 +00:00
InventoryHelpersTest.cs Stunnable New Status and Cleanup (#38618) 2025-11-23 15:22:21 -06:00
LogErrorTest.cs Remove obsolete TestPair.Pair (#19496) 2023-08-25 10:56:51 +10:00
MachineBoardTest.cs Code Cleanup: Integration Tests (#29584) 2024-08-09 17:26:13 +01:00
MagazineVisualsSpriteTest.cs Cleanup more `SpriteComponent` warnings (part 2) (#37527) 2025-05-18 17:58:43 +01:00
MappingEditorTest.cs Add mapping editor (#23427) 2024-09-22 02:44:27 +01:00
MaterialArbitrageTest.cs CompFactory updates (#37559) 2025-08-04 15:25:05 +02:00
PostMapInitTest.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
PrototypeSaveTest.cs Sloth's subfloor vismask adventure (#35347) 2025-03-23 16:15:07 +00:00
ResearchTest.cs edit RE test to use packs 2025-02-14 16:10:02 +00:00
ResettingEntitySystemTests.cs fix antag selection being evil (#28197) 2024-06-01 17:13:27 +02:00
RestartRoundTest.cs Mark all tests that restart rounds as dirty (#21376) 2023-11-12 20:29:56 +01:00
RoundEndTest.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
SalvageTest.cs Refactor map loading & saving (#34020) 2025-03-01 13:20:37 +00:00
SaveLoadMapTest.cs Refactor map loading & saving (#34020) 2025-03-01 13:20:37 +00:00
SaveLoadSaveTest.cs Refactor map loading & saving (#34020) 2025-03-01 13:20:37 +00:00
ShuttleTest.cs Code Cleanup: Integration Tests (#29584) 2024-08-09 17:26:13 +01:00
StartTest.cs Remove obsolete TestPair.Pair (#19496) 2023-08-25 10:56:51 +10:00
StorageTest.cs CompFactory updates (#37559) 2025-08-04 15:25:05 +02:00
StoreTests.cs Fix StoreTests EventBus usage (#38489) 2025-11-23 15:22:14 -06:00
VendingMachineRestockTest.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
XenoArtifactTest.cs 3mo xeno archeology (first phase) (#33370) 2025-04-23 12:52:41 +01:00