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

Data Stage Unit Tests #823

Open
KiwiHawk opened this issue Aug 21, 2022 · 3 comments
Open

Data Stage Unit Tests #823

KiwiHawk opened this issue Aug 21, 2022 · 3 comments
Assignees
Labels
Angels Unit Tests unit test related Impact: Enhancement Improvements, not pressing

Comments

@KiwiHawk
Copy link
Collaborator

Data Stage Test Mods

Idea was suggested in discussion on PR #819.

Create two new testing mods to do data stage checks. One mod should run first, before any other mods. Other mod should run last.

Tests

Missing recipe tints

Currently, if the unit test mod is enabled, Angel's Petrochem will check for missing recipe tints and print a warning to log. This could be moved to the new mod.

Accidental globals

Check for references to undeclared variables and accidental globals. These type of issues had been fixed in #819.

setmetatable(_G, {
  __newindex = function (_, n)
    error("attempt to write to undeclared variable "..n)
  end,
  __index = function (_, n)
    error("attempt to read undeclared variable "..n)
  end,
})
@LovelySanta
Copy link
Collaborator

Create two new testing mods to do data stage checks. One mod should run first, before any other mods. Other mod should run last.

I am still of the opinion that the angelsdev-unit-test can take the role as the one loading last. If we do want to test some complex entities in the future (requiring custom event handling), then having the unit test run last will be wanted anyway...
=> 1 new mod to load before other mods
=> extend the unit test mod to do verifications on the 'final' data structure in data-final-fixes

@LovelySanta LovelySanta added Impact: Enhancement Improvements, not pressing Angels Unit Tests unit test related labels Aug 21, 2022
@KiwiHawk
Copy link
Collaborator Author

I am still of the opinion that the angelsdev-unit-test can take the role as the one loading last.

As long as we only use optional dependencies, that should be okay with me. I want to be able to run the unit tests against other mod packs, not just Angel's.

@LovelySanta
Copy link
Collaborator

As long as we only use optional dependencies

Ofc it would be optional (and hidden) (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Angels Unit Tests unit test related Impact: Enhancement Improvements, not pressing
Projects
None yet
Development

No branches or pull requests

2 participants