Skip to content
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

Tests: give seed on default tests and fix execnet error #3520

Merged
merged 11 commits into from
Jun 22, 2024

Conversation

Silvris
Copy link
Collaborator

@Silvris Silvris commented Jun 12, 2024

What is this fixing or adding?

https://github.com/ArchipelagoMW/Archipelago/actions/runs/9488885076/job/26148887892

A test failure that gives effectively no information about the failure. With these changes, we catch the exception being thrown such that the seed passed into subTest will get printed into the logs, allowing for reproduction of the error locally. While this is a stopgap solution, I couldn't find much information about the cause of the error itself.

The issue is that we pass location into self.subTest, when really all we want there is location.name. This PR instead fixes this issue alongside providing seed on failing tests.

How was this tested?

https://github.com/Silvris/Archipelago/actions/runs/9489978465/job/26152426677
https://github.com/Silvris/Archipelago/actions/runs/9533282014/job/26276353017
Manually, by forcefully failing the test within the for loop of all_state_can_reach_everything.

Unittests were also ran locally.

@github-actions github-actions bot added the waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. label Jun 12, 2024
@Exempt-Medic Exempt-Medic added the is: enhancement Issues requesting new features or pull requests implementing new features. label Jun 12, 2024
test/bases.py Outdated Show resolved Hide resolved
@ScipioWright ScipioWright added is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. and removed is: enhancement Issues requesting new features or pull requests implementing new features. labels Jun 16, 2024
@Silvris Silvris changed the title Tests: give seed on default tests and try to mitigate execnet error Tests: give seed on default tests and fix execnet error Jun 16, 2024
excluded = self.multiworld.worlds[self.player].options.exclude_locations.value
state = self.multiworld.get_all_state(False)
for location in self.multiworld.get_locations():
if location.name not in excluded:
with self.subTest("Location should be reached", location=location):
with self.subTest("Location should be reached", location=location.name):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this keep failing the serialization dumping? i thought we had a proper repr for location, but if we don't i think that's probably the better fix for this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the cause of the serialization function failing within tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at it, Location does have a _repr_ that calls _str_. We could use str(location) instead, but the end result is the same.

Copy link
Member

@NewSoupVi NewSoupVi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fast tracking this a bit because the reproducability issue is quite pressing.

If there is a better way to do the location serialisation thing, I will be happy to look at another PR for it

@NewSoupVi NewSoupVi merged commit 5ca3153 into ArchipelagoMW:main Jun 22, 2024
17 checks passed
qwint pushed a commit to qwint/Archipelago that referenced this pull request Jun 24, 2024
…W#3520)

* output seed of default tests

* test execnet fix

* try failing with interpolated string

* Update bases.py

* try without tryexcept

* Update bases.py

* Update bases.py

* remove fake exception

* fix indent

* actually fix the execnet issue

---------

Co-authored-by: NewSoupVi <[email protected]>
GameWyrm pushed a commit to GameWyrm/Archipelago-GW that referenced this pull request Jul 4, 2024
…W#3520)

* output seed of default tests

* test execnet fix

* try failing with interpolated string

* Update bases.py

* try without tryexcept

* Update bases.py

* Update bases.py

* remove fake exception

* fix indent

* actually fix the execnet issue

---------

Co-authored-by: NewSoupVi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. 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.

5 participants