You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensures that CI and local development workflows behave the same (#941)
I discovered an issue in CI where `lute test` would fail to require the
`difftext` test file. Instead of causing CI to fail, this would silently
skip that test suite. Moreover, there is a divergence in how tests run
in the presence of the .ci.luaurc file vs the .luaurc file.
Today, we don't define a batteries alias in the .ci.luaurc because we
have tests that rely on asserting that user code cannot require
batteries. This also causes a divergence in how C++ and luau tests are
run
- luau tests pass with the regular .luaurc because some tests rely on
the .luaurc to figure out where batteries are located.
- luau tests fail with the .luaurc.ci because that doesn't have a
batteries alias.
- C++ tests pass with the .luaurc.i because that doesn't have a
batteries alias
- C++ tests fail with the regular .luaurc because the batteries alias is
defined in the root of the repo
The cause of the luau tests failing is that `loadModule` loads a test
case as user code, which has no access to @Batteries. It uses a .luaurc
to find the local `@batteries`. The `difftext` battery itself requires
the `deque` module in batteries, which causes us to look for a
@Batteries alias somewhere (which doesn't exist in CI). To fix this,
I've added a .luaurc with the `@batteries` alias defined to the
batteries/ directories.
I've also:
- gotten rid of the step that changes the luaurc we run with in CI
- added .luaurc's to files that rely on local access to batteries,
either for execution (examples/ tools/) or for editor support
(std/libs).
- added a ps.exit(1), so that test running failures will cause CI to
fail.
0 commit comments