Skip to content

test & linter debug guide#629

Open
mqole wants to merge 2 commits intospace-wizards:masterfrom
mqole:tests
Open

test & linter debug guide#629
mqole wants to merge 2 commits intospace-wizards:masterfrom
mqole:tests

Conversation

@mqole
Copy link
Copy Markdown
Contributor

@mqole mqole commented Mar 23, 2026

resolves #231

Copy link
Copy Markdown
Member

@beck-thompson beck-thompson left a comment

Choose a reason for hiding this comment

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

This is amazing! Really necessary part that was missing 🤩


To run integration tests, use the shell command `dotnet test` in your project folder. You can also use `dotnet test --filter` followed by the name of a specific test if you don't want to run every test at once. This is recommended as some tests can take a long time to run! IDEs such as Rider or VSCode may also have built-in ways to run tests without using the terminal.

When you open a PR to the Wizard's Den repository on GitHub, integration tests will run on your PR automatically. If tests fail, you'll need to update your PR before it can get properly reviewed.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add some info / images on how to see the output of the tests? A lot of new people struggle with this!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

could you grab an appropriate image for me? id love to add one but im not certain what you want the image to include exactly

When you open a PR to the Wizard's Den repository on GitHub, integration tests will run on your PR automatically. If tests fail, you'll need to update your PR before it can get properly reviewed.

```admonish note
`Content.IntegrationTests` is the directory containing integration tests. It is not the same thing as the similarly-named `Content.Tests` folder. You should run the tests in both of these folders to debug your changes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

integration testing is much different from unit testing. you should describe the differences between them and remark that the feature being PRd should have tests (whether it can be unit tested, integration tested, or both). saying "you should run the tests in both of these folders" is a bit unclear

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

how would you describe the differences between them? ive only ever needed to run integration tests on things, i wasnt aware unit tests had a significant difference

Copy link
Copy Markdown
Member

@Tayrtahn Tayrtahn Mar 25, 2026

Choose a reason for hiding this comment

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

The short version is that unit tests test a single "unit" (typically a class) while integration tests test that multiple units work together correctly.

For example, a there's a unit test that uses spoofed data to make sure that the methods of LocalizedDataset work as expected - correctly enumerating its entries, etc. This test doesn't need to bring in any other systems in order to run.

By contrast, there's also an integration test that loads up all the localized dataset instances in the game (going through resource loading, yaml parsing, prototype management, etc) and makes sure that they're set up correctly.

Unit/integration tests are used widely in software development outside of SS14, so Google can provide you with more info about the concepts and their differences.

Edit: I lied, the "unit" test example actually does use some dependencies, so it's not a "pure" unit test. The hypothetical test I described is still a good example though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

There should be documentation on how to run tests

4 participants