-
Notifications
You must be signed in to change notification settings - Fork 57
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
Chore(test): Actor test suite #356
Chore(test): Actor test suite #356
Conversation
Started on this one, requesting backup because this is in large part a refactor of recent code by @wyrmisis and of course his opinion is valued :) |
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.
29/36 files reviewed
I would still like to get my eyes on all of them but for now I have a few comments/questions for you to look at
src/e2e/testUtils.ts
Outdated
|
||
export const closeDialogs = async () => { | ||
openDialogs()?.forEach(async (o) => { | ||
await o.close(); | ||
}); | ||
}; | ||
|
||
export const closeSheets = async () => { | ||
openWindows("sheet").forEach(async (w) => w.close()); | ||
await delay(220); |
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.
out of curiosity was 120 not enough on your machine? (as used for the dialog closing input delay constant at the top)
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.
My machine must have had a bad day or something, I just tried changing it to the standard and it works. So I'll put this as the standard.
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 going to be completely honest with you: as long as these tests pass, I'm good. There is a lot here and I don't know if I have the brain space to give them the thorough reading necessary.
What's here is a good baseline, IMO. We can fix the tests as we fix bugs related to said tests.
(commenting instead of approving since I haven't been able to read all the things)
src/e2e/testUtils.ts
Outdated
|
||
export const closeDialogs = async () => { | ||
openDialogs()?.forEach(async (o) => { | ||
await o.close(); | ||
}); | ||
}; | ||
|
||
export const closeSheets = async () => { | ||
openWindows("sheet").forEach(async (w) => w.close()); | ||
await delay(220); |
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.
Should we be returning this await?
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 added it there (and changed it based on @anthonyronda's comment to waitForInput()
) so to not having to add it everywhere we're waiting for the sheets to close. But I can change that if that is preferrable?
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 conflicted on if we should even have sheet tests if we plan on doing new sheets in the future.
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.
UFT doesn't have to inherit them, the OSE project can inherit them. As long as you don't mind having them here for now, I can help separate the imports at the testing entrypoint later
src/e2e/testUtils.ts
Outdated
game.messages.size > 0 | ||
? game.messages.documentClass.deleteDocuments([], { deleteAll: true }) | ||
export const trashChat = (): Promise<any> => | ||
game.messages?.size > 0 |
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.
Since we're using a question mark here, maybe we ought to check for if game.messages?.size
is truthy, instead of checking for if it's greater than 0.
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.
Makes sense, I think I put the question mark there as I got warnings that it may be empty. But since we are running tests with Foundry initiated, I think we can just do a straight check here.
3ab54c6
to
1056765
Compare
All the tests won't pass, so it is a question if we should merge the test suite and work off the failing tests. When I run with all the fixes I've put together I get 1069/1129 tests passing right now though. |
Any chance you could list out what all is failing, and what all will pass when whatever PRs you have out there go in? No biggie if not, I know that's a fair bit of book-keeping. |
Note: Lots of the failing tests are due to large quantity of HD rolling tests.
Failing TestsThis branch as-is: 861/1128 With HD fixes (#372 ): 1044/1129 tests, failing tests:
With #372 & #359: 1067/1129
I have commits to fix:
Remaining failing tests
|
@bakbakbakbakbak thanks for listing the failing tests. If you'd like to, please share your WIPs for the ones on a local branch :) |
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.
LGTM
I will be honest, I did not scour each and every test (I'm particularly worried about false positives, which are harder to pick out)
I did look over them generally. If there are some mistakes in here, it's not the end of the world or even going to affect people's games too much :)
Thanks for such a gigantic contribution 🎉
game.messages.size > 0 | ||
? game.messages.documentClass.deleteDocuments([], { deleteAll: true }) | ||
: null; | ||
export const trashChat = (): any => { |
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.
Don't know if this passes linting for the current ESLint config. That said, we may have to revisit discussion of the FVTT Types project anyway...
I'm hoping to re-spark discussion on a path forward for accepting fixes on the remaining failing tests before merging. Let us know how we can help forge a path forward! My own view is that it's much more helpful for us to collaborate on fixes if we have the failing tests in 1.8.x. I don't want to merge 1.8.x into main, however, until all tests are green |
I've submitted the PRs #372 #373 #374 now (and references them in the comment above)! |
This PR introduces tests for Actors up to Sheet level. It is not complete as I've been unable to figure all the tests out, but the test coverage should be quite high with this.
I'm putting this as a draft PR for a few days while I continue linting give a night or two of good rest to simmer.