-
Notifications
You must be signed in to change notification settings - Fork 924
Tests: test a single-player generation through generate_output #4931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
game: ClassVar[str] | ||
|
||
def test_single_player_game_can_generate_output(self) -> None: | ||
if self.game in ("Archipelago", "Sudoku", "Final Fantasy"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the proper way for us to check Final Fantasy or sudoku is, but generic can at least be skipped with hidden which it should probably be done that way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly the best solution for Sudoku is probably marking it hidden and figuring out a way for it to keep its docs on Webhost (or a new field that does exactly that).
Final Fantasy we just have to manually exclude, but since Final Fantasy's output is handled by FFR upstream, we don't have to worry about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW though Archipelago doesn't actually fail the test. It just doesn't make sense to test it at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sudoku signals it can't generate to the webhost with web.options_page = False so ???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing else in core uses that as a signal though. You still get Sudoku yamls produced by the launcher.
output = tempfile.TemporaryDirectory() | ||
with output as temp_dir: | ||
call_stage(self.multiworld, "generate_output", temp_dir) | ||
call_single(self.multiworld, "generate_output", 1, temp_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it make sense for us to assert that the world actually put something in the temp directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can, but then we'd also have to filter out all worlds where world_type.generate_output == World.generate_output
.
What is this fixing or adding?
Adds a test that generates a single player multiworld with a given game, then runs
stage_generate_output
andgenerate_output
with the multiworld.How was this tested?
It's a unit test, ran unit tests. On opening this PR, the only failure should be The Wind Waker (which has been reported).
If this makes graphical changes, please attach screenshots.