Example icon indicating copy to clipboard operation
Example copied to clipboard

Client tests

Open MarhiievHE opened this issue 1 year ago • 10 comments

Update client test

MarhiievHE avatar May 04 '23 19:05 MarhiievHE

@tshemsedinov Perhaps partially. Maybe it will be better if @leonpolak looks at whether everything is present, what he expected. I did not look at PR #204, but just corrected what interfered with the work of the test. PS: I gave access to changes to my Fork.

MarhiievHE avatar May 05 '23 05:05 MarhiievHE

Looks like redis can't be accessed in docker: unhandledRejection: Error: connect ECONNREFUSED 127.0.0.1:6379 @MarhiievHE

tshemsedinov avatar May 05 '23 11:05 tshemsedinov

Looks like redis can't be accessed in docker: unhandledRejection: Error: connect ECONNREFUSED 127.0.0.1:6379 @MarhiievHE

You are right, I have forgotten to add optional support running API under a container with Redis. Ok, I will add a config for Redis.

MarhiievHE avatar May 05 '23 11:05 MarhiievHE

@tshemsedinov Do you have any other suggestions to improve or add some more tests?

MarhiievHE avatar May 06 '23 20:05 MarhiievHE

@tshemsedinov Do you have any other suggestions to improve or add some more tests?

Tests are still failing https://github.com/metarhia/Example/pull/225/checks

tshemsedinov avatar May 06 '23 21:05 tshemsedinov

@tshemsedinov Do you have any other suggestions to improve or add some more tests?

Tests are still failing https://github.com/metarhia/Example/pull/225/checks

It's because the test.yml haven't any instance of Redis in the test environment.

MarhiievHE avatar May 06 '23 21:05 MarhiievHE

Please rebase on master

tshemsedinov avatar Aug 03 '23 16:08 tshemsedinov

Sorry for such a massive delay in the review. Everything works and all required tests pass (Huge respect to Heorhii and Timur). Just 3 questions:

  1. Where is uploaded content stored?
  2. Is 'example/subscribe' should work like this? Shouldn't it listen indefinitely for server-side events, until some 'unsubscribe' call?
  3. I get 'warning: MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [MetaReadable]'. I obviously can use emitter.setMaxListeners(11), but it does not feel right.

You're welcome.

  1. There are two examples of file upload. The first through the Metacom stream saves to the path /application/resources/. The second through serialization, saves to the path application/tmp/.
  2. I agree will be well expanding the algorithm.
  3. Perhaps this version of the code refers to an old Metacom not yet been corrected. It will be necessary to apply changes from the master and see if the problem remains.

PS: I was a little busy in August, I was preparing for a language exam, and now I want to return to rewriting the Metatest library on the node test runner. But on Thursday, I plan to be on the community call and it will be possible to discuss what is not enough to close this PR.

MarhiievHE avatar Sep 12 '23 13:09 MarhiievHE

@leonpolak @tshemsedinov I rewrote the test to use a node test runner and fixed a subscription check. And I also corrected the GitHub Actions script. Now, all tests are completed correctly.

MarhiievHE avatar Sep 15 '23 17:09 MarhiievHE

@leonpolak Did you talk about this error before? I caught it too now with node version 18. image

19:59:09  W2   error   warning: MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 Symbol() listeners added to [MetaReadable]. Use emitter.setMaxListeners() to increase limit
  _addListener (node:events:587:17)
  MetaReadable.addListener (node:events:605:10)
  MetaReadable.once (node:events:649:8)
  eventTargetAgnosticAddListener (node:events:1004:15)
  node:events:966:5
  new Promise (<anonymous>)
  Function.once (node:events:949:10)
  MetaReadable.push (/node_modules/metacom/lib/streams.js:45:26)
  Server.binary (/node_modules/metacom/lib/server.js:300:18)

MarhiievHE avatar Sep 21 '23 20:09 MarhiievHE