goat-community / goat

This is the home of Geo Open Accessibility Tool (GOAT)
GNU General Public License v3.0
91 stars 47 forks source link

Increase test coverage backend #1828

Open metemaddar opened 1 year ago

metemaddar commented 1 year ago

Goal of this issue

Add the tests which are mentioned. These tests are mentioned by TODO inside tests directory.

Resources

List of TODOs:

- [ ] #1840
- [ ] #1841
- [ ] #1842
- [ ] https://github.com/goat-community/goat/issues/1281
- [ ] https://github.com/goat-community/goat/issues/1793
- [ ] https://github.com/goat-community/goat/issues/1946

Deliverables

Branch to derive

dev

metemaddar commented 1 year ago

Moved from issue #1946

metemaddar commented 1 year ago

The Tests are now sequential by 6878c2d03ee74ca8257d371d1d9692031a716ef6

I'm trying to make tests independent from REDIS (Results backend) if possible.

metemaddar commented 1 year ago

The indicators async implementation was done 8c6f732067683d61a3b02f48f3a14d8be65ec142. And there were a concern about the client for if the async/await of JavaScript still makes CPU busy and hot. Fortunately as ChatGPT says, it will not block the CPU. So we can implement the indicators without set/result endpoints, and at the client side we can get the results asynchronously on one request.

From Chat GPT:

The async/await syntax in JavaScript is used to write asynchronous code that runs concurrently without blocking the execution of other tasks. It does not necessarily make the CPU busy and hot, but it depends on the implementation of the asynchronous tasks and how they are scheduled.

In general, asynchronous tasks such as network I/O or disk I/O operations are non-blocking and do not consume CPU resources while waiting for the operation to complete. Instead, the operating system or runtime environment handles the task and signals the application when the operation is complete.