-
Notifications
You must be signed in to change notification settings - Fork 9
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
Running tests locally: How to? #958
Comments
Also we noted, that running tests from a package-subdir fails (probably since jest is not a dev-dependency of each package). Finally, we noted that we cannot trigger a test with watch easily. Is there parameter in pnpm which we need to set in order to pass the watch-parameter to the module? In other words: How the heck do you test locally in an efficient manner? |
/cc @jschirrmacher |
hey @mrsimpson ! |
@nessur great to get to know you and thanks for the offered help. I'll try to document what I understood and where things go wrong PrerequisitesAs per my understanding:
I am running a (compose-based) redis and postgres locally. Executing testsRunning 1. Database
|
Regarding 3, this problem occurs in our special environment because we use |
I don't have all the answers yet, but your DB config issue with (2. Pretest) is that
where |
@nessur Thx, I'm well aware of that. And what you say actually confirms my guess: There is some external configuration (e. g. your zsh-environment) which I don't have. |
Not a bad suggestion. I don't love relying both on Can you try removing |
I removed the
Remark: My containerized postgres does not allow for a passwordless login, but I use |
If we know, which scripts in dependencies we want to execute, it is still possible to do so by running can-i-ignore-scripts Tool helps us to figure out, which scripts exist and which we want to be run. |
Re: 3, I have an M1 machine too, and I can't seem to reproduce... What version of |
@avatarneil with respect to EDIT: I removed the pnpm cache and re-installed. No clue why, but now the post-installations scripts are being executed:
|
Thanks for that hint! In fact, there was a left-over in my
This was the first thing I tried – developing without an interactive debugger is just no option for me. I hear legends of trace-only-developers, aka I am as well using VSCode, but the breakpoints are not picked up. Running the tests from the test-explorer fails (I assume that's an issue similar to 4) above: When executing a single tes, the node_modules from the workspace root are not considered). If I set the BP and execute via |
@avatarneil current failure:
P. S. Any functional reason to run the test sequentially? As a lucky user of an M1, I prefer |
@avatarneil the above failure is due to my In our projects we are using DOTENV-flow which supports |
Having written the above, I propose to use |
@mrsimpson we run the tests sequentially to avoid suites potentially colliding when using shared resources, and invalidating other tests. For example, imagine tests from one package generate & persist a bunch of devices, and tests from another package expect there to only be one device returned from a query (or something along those lines). Also, dotenv-flow looks great! Very interested in checking it out :) |
@mrsimpson any progress on this? Or, you still stuck on |
I am still stuck on running individual package-tests. Most of the issues seem to have been env related. Let me rebase the referencing PR. Once this is merged, I'll follow up on the rest of this issue, e. g. By providing a compose-file which spins up an always-fresh configured Postgres and Redis. |
When running tests locally, there are a couple of issues which we encounter
"typeorm": "export $(cat ../../.env | xargs) && ts-node ./node_modules/typeorm/cli.js"
)403
are not met)Is there something we need to configure locally in order to make the tests run?
The text was updated successfully, but these errors were encountered: