Comments (7)
Every single failing test has from its dependency
in the test description. I'm thinking there's something wrong when it comes to propagating dependent changes.
from 5esheets.
Tests are ... passing with node 18.16.0 and failing with node 20.3.1.
from 5esheets.
I've defined a Dockerfile for the frontend, as such
FROM node:18.16.1
WORKDIR /usr/src/app
COPY package-lock.json .
COPY package.json .
RUN npm install
and built it with cd dnd5esheets/front && docker build -t 5esheets-front .
. In then renamed my local node_modules
to node_modules-old
to avoid shadowing the node_modules
in the container, and ran cd dnd5esheets/front && docker run -it -v "$(pwd)/:/usr/src/app/" 5esheets-front bash
root@3195b611cbe7:/usr/src/app# npm exec vitest --config vitest.config.js src/effects/index.test.ts src/effects/parser/index.test.ts
DEV v0.32.2 /usr/src/app
✓ src/effects/parser/index.test.ts (10)
✓ src/effects/index.test.ts (18)
Test Files 2 passed (2)
Tests 27 passed | 1 skipped (28)
Start at 12:27:26
Duration 4.35s (transform 164ms, setup 1.28s, collect 368ms, tests 17ms, environment 2.50s, prepare 415ms)
That works
from 5esheets.
I then built another docker image defined as
FROM node:20.2.0-bullseye-slim
WORKDIR /usr/src/app
COPY package-lock.json .
COPY package.json .
RUN npm install
and ran the same steps. This time, the tests failed:
root@92519af685a1:/usr/src/app# npm exec vitest --config vitest.config.js src/effects/index.test.ts src/effects/parser/index.test.ts
DEV v0.32.2 /usr/src/app
✓ src/effects/parser/index.test.ts (10)
❯ src/effects/index.test.ts (18)
❯ apply effect (18)
× applies a static effect
× applies a derived effect
× applies a derived effect which updates from its dependency
× applies a nested derived effect
× applies a nested derived effect which updates from its dependency
× applies a deeply nested derived effect
× applies a nested derived effect which updates from its dependency
× applies a non-computed nested derived effect
× applies a non-computed nested derived effect which updates from its dependency
× applies a non-computed deeply nested derived effect
× applies a non-computed deeply nested derived effect which updates from its dependency
× applies an effect containing a function
× applies a derived effect containing a function
× applies a derived effect containing a function which updates from its dependency
× applies a somewhat complex effect which updates from its dependency
× applies a somewhat complex effect on a nested target which updates from its dependency
× applies a nested derived effect on a sibling target which updates from its dependency
↓ applies a derived effect containing a function which updates from its dependency [skipped]
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 17 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL src/effects/index.test.ts > apply effect > applies a static effect
TypeError: Cannot read properties of undefined (reading 'registerGraph')
❯ Module.createStore node_modules/solid-js/store/dist/dev.js:213:9
❯ src/effects/index.test.ts:21:37
❯ src/effects/index.test.ts:11:7
❯ updateFn node_modules/solid-js/dist/dev.js:180:17
❯ runUpdates node_modules/solid-js/dist/dev.js:800:17
❯ Module.createRoot node_modules/solid-js/dist/dev.js:185:12
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:20:5
...
At that point, we see the issue that I tried to fix in #96. I thus prefix the command by exporting NODE_ENV=whatever
root@b62e906cd236:/usr/src/app# NODE_ENV=development npm exec vitest --config vitest.config.js src/effects/index.test.ts src/effects/parser/index.test.ts
DEV v0.32.2 /usr/src/app
✓ src/effects/parser/index.test.ts (10)
❯ src/effects/index.test.ts (18)
❯ apply effect (18)
✓ applies a static effect
✓ applies a derived effect
× applies a derived effect which updates from its dependency
✓ applies a nested derived effect
× applies a nested derived effect which updates from its dependency
✓ applies a deeply nested derived effect
× applies a nested derived effect which updates from its dependency
✓ applies a non-computed nested derived effect
× applies a non-computed nested derived effect which updates from its dependency
✓ applies a non-computed deeply nested derived effect
× applies a non-computed deeply nested derived effect which updates from its dependency
✓ applies an effect containing a function
✓ applies a derived effect containing a function
× applies a derived effect containing a function which updates from its dependency
× applies a somewhat complex effect which updates from its dependency
× applies a somewhat complex effect on a nested target which updates from its dependency
× applies a nested derived effect on a sibling target which updates from its dependency
↓ applies a derived effect containing a function which updates from its dependency [skipped]
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 9 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL src/effects/index.test.ts > apply effect > applies a derived effect which updates from its dependency
AssertionError: expected 1 to be 2 // Object.is equality
- Expected
+ Received
- 1
+ 2
❯ src/effects/index.test.ts:38:25
36| applyEffect("b := a", context, setContext);
37| setContext("a", 2);
38| expect(context.b).toBe(context.a);
| ^
39| }));
40|
❯ src/effects/index.test.ts:11:7
❯ Module.createRoot node_modules/solid-js/dist/server.js:53:14
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:34:5
...
@etnbrd do you want to try to debug this, or should we pin node to 18.16.1 and call it a day?
from 5esheets.
Frontend tests are succeeding when using node 18.16.1 in CI: https://github.com/brouberol/5esheets/actions/runs/5464409518/jobs/9946400764?pr=97
from 5esheets.
If it works with 18.16.1, let's use this version, and we'll retry later to have a better understanding of what's wrong.
from 5esheets.
Cool. I've added an .nvmrc
file containing the node version we pinned the project to, installable via nvm
.
~/code/5esheets main *2 ❯ node --version
v18.16.1
~/code/5esheets main *2 ?3 ❯ make front-test
[+] Running the frontend tests
> test
> vitest
DEV v0.32.2 /Users/br/code/5esheets/dnd5esheets/front
✓ src/effects/parser/index.test.ts (10)
✓ src/effects/index.test.ts (18)
Test Files 2 passed (2)
Tests 27 passed | 1 skipped (28)
We're all good!
from 5esheets.
Related Issues (20)
- Change the data model to avoid string concatenation in effect calculations
- Express the spell DC and spell attack bonus with the revamped effect system HOT 1
- Define the schema of an `Item` internal data
- Define the schema of a `Spell` internal data
- Store all updates made to a `Character` row to Database
- Add validation on character level
- Setup plain logging in dev and json in production
- Include a correlation ID in the request logs as well as the response headers
- Display rich request/response logging context
- Update the character data via the API when updating the character sheet
- Implement search APIs for translated resources
- Implement a policy/permission system based on roles
- Import non-basic items in database
- Add the option to display the character's avatar in the character sheet
- Pin the sqlite version
- Don't run the container as `root`
- Experiment with ruff format va black
- Add exhaustion levels into the backend models and schemas
- Investigate actionlint to lint GitHub actions files
- Rework model to support multiclassing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 5esheets.