Skip to content

Is redis mandatory for testing ? #6508

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

Closed
oallouch opened this issue Mar 14, 2020 · 7 comments
Closed

Is redis mandatory for testing ? #6508

oallouch opened this issue Mar 14, 2020 · 7 comments
Labels
type:question Support or code-level question

Comments

@oallouch
Copy link
Contributor

oallouch commented Mar 14, 2020

Hi,

I'm on Windows and I'd like to run a single test (eg: ReadPreferenceOption.spec.js).
As specified in CONTRIBUTING.md , I used VS Code (I usually code on Webstorm) and installed Jasmine Test Explorer.
The env var PARSE_SERVER_TEST_CACHE isn't set.
But I get an error as it tries to connect to a localRedis on port 6379.

I am doing somethiing wrong ? I know you don't have many contributors (if any) on Windows.

Thx in advance,

Olivier Allouch

@dplewis
Copy link
Member

dplewis commented Mar 22, 2020

It shouldn't be. There is only one test suite using redis.

https://github.com/parse-community/parse-server/blob/edfa1df454f0e76946c231a4573822cb870affde/spec/RedisCacheAdapter.spec.js

And the /spec/helper.js

If you don't have it set. It shouldn't throw an error. Can you try debugging this?

@oallouch
Copy link
Contributor Author

I installed it, but still got plenty of errors on Windows.

@dplewis
Copy link
Member

dplewis commented Mar 29, 2020

@oallouch What errors are you seeing?

@oallouch
Copy link
Contributor Author

When I do "npm run test", it starts (mostly) ok, but when it gets to MongoStorageAdapter, it gives me :

MongoStorageAdapter
× auto-escapes symbols in auth information (5 secs)
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
× doesn't double escape already URI-encoded information (5 secs)
- Failed: ns not found
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
√ preserves replica sets (5 secs)
√ stores objectId in _id (4 secs)
× find succeeds when query is within maxTimeMS (7 secs)
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
× find fails when query exceeds maxTimeMS (8 secs)
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
× stores pointers with a p prefix (7 secs)
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
× handles object and subdocument (7 secs)
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
× handles creating an array, object, date (7 secs)
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
× handles updating a single object with array, object date (7 secs)
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
× handleShutdown, close connection (7 secs)
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
× getClass if exists (7 secs)
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
× getClass if not exists (7 secs)
- Error: Timeout - Async callback was not invoked within 5000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)

even if my local mongo gets filled with many Collections

I think I did something stupid, but don't know what.

@oallouch
Copy link
Contributor Author

oallouch commented Apr 2, 2020

Ok, I was missing some code updated. Now the error message is clearer. It can't find the mongodb version it needs using mongodb-version-list at the page http://dl.mongodb.org/dl/src/ .

@oallouch
Copy link
Contributor Author

oallouch commented Apr 3, 2020

@dplewis The problem was cross-env. On Windows it doesn't handles variables well by default, and when I change the npm shell as adviced, it's even worse.
https://github.com/kentcdodds/cross-env#windows-issues
So I changed the scripts in package.json like
"testonly": "cross-env MONGODB_VERSION=4.0.4 MONGODB_TOPOLOGY=standalone MONGODB_STORAGE_ENGINE=mmapv1 TESTING=1 jasmine",

Many tests fail, but I runs.

image

@mtrezza
Copy link
Member

mtrezza commented Feb 19, 2021

I'm closing this as it does not seem to be a Parse Server but rather an environment-specific issue.

For help with Parse Server, here are some resources you can try:

  • For code-level questions we recommend Stack Overflow using the parse-platform tag.
  • For network and server questions we recommend ServerFault using the parse-server tag
  • For questions that are not appropriate for the above mentioned sites we recommend our community forum.

Feel free to comment if you have any questions and we can re-open this issue.

@mtrezza mtrezza closed this as completed Feb 19, 2021
@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

3 participants