mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Stardew Valley: 5.x.x - The Allsanity Update (#2764)
Major Content update for Stardew Valley, including the following features - Major performance improvements all across the Stardew Valley apworld, including a significant reduction in the test time - Randomized Farm Type - Bundles rework (Remixed Bundles and Missing Bundle!) - New Settings: * Shipsanity - Shipping individual items * Monstersanity - Slaying monsters * Cooksanity - Cooking individual recipes * Chefsanity - Learning individual recipes * Craftsanity - Crafting individual items - New Goals: * Protector of the Valley - Complete every monster slayer goal * Full Shipment - Ship every item * Craftmaster - Craft every item * Gourmet Chef - Cook every recipe * Legend - Earn 10 000 000g * Mystery of the Stardrops - Find every stardrop (Maguffin Hunt) * Allsanity - Complete every check in your slot - Building Shuffle: Cheaper options - Tool Shuffle: Cheaper options - Money rework - New traps - New isolated checks and items, including the farm cave, the movie theater, etc - Mod Support: SVE [Albrekka] - Mod Support: Distant Lands [Albrekka] - Mod Support: Hat Mouse Lacey [Albrekka] - Mod Support: Boarding House [Albrekka] Co-authored-by: Witchybun <elnendil@gmail.com> Co-authored-by: Witchybun <96719127+Witchybun@users.noreply.github.com> Co-authored-by: Jouramie <jouramie@hotmail.com> Co-authored-by: Alchav <59858495+Alchav@users.noreply.github.com>
This commit is contained in:
52
worlds/stardew_valley/test/stability/TestStability.py
Normal file
52
worlds/stardew_valley/test/stability/TestStability.py
Normal file
@@ -0,0 +1,52 @@
|
||||
import json
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from BaseClasses import get_seed
|
||||
from .. import SVTestCase
|
||||
|
||||
# <function Location.<lambda> at 0x102ca98a0>
|
||||
lambda_regex = re.compile(r"^<function Location\.<lambda> at (.*)>$")
|
||||
# Python 3.10.2\r\n
|
||||
python_version_regex = re.compile(r"^Python (\d+)\.(\d+)\.(\d+)\s*$")
|
||||
|
||||
|
||||
class TestGenerationIsStable(SVTestCase):
|
||||
"""Let it be known that I hate this tests, and if someone has a better idea than starting subprocesses, please fix this.
|
||||
"""
|
||||
|
||||
def test_all_locations_and_items_are_the_same_between_two_generations(self):
|
||||
if self.skip_long_tests:
|
||||
return
|
||||
|
||||
# seed = get_seed(33778671150797368040) # troubleshooting seed
|
||||
seed = get_seed()
|
||||
|
||||
output_a = subprocess.check_output([sys.executable, '-m', 'worlds.stardew_valley.test.stability.StabilityOutputScript', '--seed', str(seed)])
|
||||
output_b = subprocess.check_output([sys.executable, '-m', 'worlds.stardew_valley.test.stability.StabilityOutputScript', '--seed', str(seed)])
|
||||
|
||||
result_a = json.loads(output_a)
|
||||
result_b = json.loads(output_b)
|
||||
|
||||
for i, ((room_a, bundles_a), (room_b, bundles_b)) in enumerate(zip(result_a["bundles"].items(), result_b["bundles"].items())):
|
||||
self.assertEqual(room_a, room_b, f"Bundle rooms at index {i} is different between both executions. Seed={seed}")
|
||||
for j, ((bundle_a, items_a), (bundle_b, items_b)) in enumerate(zip(bundles_a.items(), bundles_b.items())):
|
||||
self.assertEqual(bundle_a, bundle_b, f"Bundle in room {room_a} at index {j} is different between both executions. Seed={seed}")
|
||||
self.assertEqual(items_a, items_b, f"Items in bundle {bundle_a} are different between both executions. Seed={seed}")
|
||||
|
||||
for i, (item_a, item_b) in enumerate(zip(result_a["items"], result_b["items"])):
|
||||
self.assertEqual(item_a, item_b, f"Item at index {i} is different between both executions. Seed={seed}")
|
||||
|
||||
for i, ((location_a, rule_a), (location_b, rule_b)) in enumerate(zip(result_a["location_rules"].items(), result_b["location_rules"].items())):
|
||||
self.assertEqual(location_a, location_b, f"Location at index {i} is different between both executions. Seed={seed}")
|
||||
|
||||
match = lambda_regex.match(rule_a)
|
||||
if match:
|
||||
self.assertTrue(bool(lambda_regex.match(rule_b)),
|
||||
f"Location rule of {location_a} at index {i} is different between both executions. Seed={seed}")
|
||||
continue
|
||||
|
||||
# We check that the actual rule has the same order to make sure it is evaluated in the same order,
|
||||
# so performance tests are repeatable as much as possible.
|
||||
self.assertEqual(rule_a, rule_b, f"Location rule of {location_a} at index {i} is different between both executions. Seed={seed}")
|
||||
Reference in New Issue
Block a user