Skip to content

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Silvris
Copy link
Collaborator

@Silvris Silvris commented Apr 27, 2025

What is this fixing or adding?

Adds a test that generates a single player multiworld with a given game, then runs stage_generate_output and generate_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.

@github-actions github-actions bot added the waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. label Apr 27, 2025
game: ClassVar[str]

def test_single_player_game_can_generate_output(self) -> None:
if self.game in ("Archipelago", "Sudoku", "Final Fantasy"):
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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 ???

Copy link
Collaborator Author

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)
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@ScipioWright ScipioWright added the is: enhancement Issues requesting new features or pull requests implementing new features. label Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants