Rafa de la Torre
aeec1922ee
Fix test and add const #543
2018-12-05 19:15:57 +01:00
Rafa de la Torre
b6251568eb
Test first, with hardcoded values (WIP) #543
2018-12-05 18:59:11 +01:00
Rafa de la Torre
8505857412
Make error_handler.test.js independent from other tests #543
...
This is needed to avoid a "test race" and get it closer to a real unit
test.
When running it along with others it passes:
```
$ make test-unit
...
48 passing (54ms)
12 pending
```
(note it relies on the ordering produced by `find`)
when running it along with some other test that reads the config, it
works as well:
```
$ test/run_tests.sh test/unit/apikeyauth.test.js test/unit/error_handler.test.js
...
3 passing (9ms)
12 pending
```
but when run in isolation, it fails:
```
$ test/run_tests.sh test/unit/error_handler.test.js
...
0 passing (15ms)
3 failing
1) error-handler should return a header with errors:
TypeError: Cannot read property 'environment' of undefined
at errorMiddleware (app/middlewares/error.js:10:28)
at Context.<anonymous> (test/unit/error_handler.test.js:53:26)
2) error-handler JSONP should return a header with error statuscode:
TypeError: Cannot read property 'environment' of undefined
at errorMiddleware (app/middlewares/error.js:10:28)
at Context.<anonymous> (test/unit/error_handler.test.js:79:26)
3) error-handler should escape chars that broke logs regex:
TypeError: Cannot read property 'environment' of undefined
at errorMiddleware (app/middlewares/error.js:10:28)
at Context.<anonymous> (test/unit/error_handler.test.js:108:26)
```
2018-12-05 16:22:48 +01:00
Daniel García Aubert
a616982ec3
Use strict mode
2018-10-24 15:42:33 +02:00
Eneko Lakasta
1bf8a06ec2
Rephrase error message
2018-06-29 13:19:32 +02:00
Eneko Lakasta
3c603d65c8
update tests messages accordingly
2018-06-27 16:27:10 +02:00
Simon Martín
1174499dcf
Merge branch 'master' into pgcopy-stream
2018-06-11 14:38:52 +02:00
Eneko Lakasta
eab3d289b6
refactor authenticated to authorizationLevel
2018-06-05 13:21:56 +02:00
Simon Martín
2f2dcfd762
fix copy format case
2018-06-04 18:15:28 +02:00
Simon Martín
0bac7a484c
improving query info
2018-05-22 14:16:22 +02:00
Simon Martín
f31f00dbbc
fix test vars naming
2018-05-22 12:05:16 +02:00
Simon Martín
81be15fbc3
adding format to copy metrics
2018-05-21 19:13:44 +02:00
Simon Martín
5f8e1d8f53
fix validatePGEntitiesAccess access
2018-04-26 10:13:03 +02:00
Simon Martín
4f6d4322f6
forgotten 'only'
2018-04-24 15:51:40 +02:00
Simon Martín
00273bc760
unit tests
2018-04-24 15:51:12 +02:00
Simon Martín
2a729b7da8
destructuring error_handler parameters
2018-04-03 13:43:17 +02:00
Simon Martín
3ad3cb7aa9
permission denied tests
2018-03-28 14:02:10 +02:00
Simon Martín
d17975d7f5
errorHandlerFactory tests
2018-03-28 13:31:45 +02:00
Simon Martín
d727a50407
jshint
2018-03-28 12:17:42 +02:00
Simon Martín
152ef05028
removing forgotten only
2018-03-28 12:15:23 +02:00
Simon Martín
8e5ac72411
simplify error_handler tests
2018-03-28 12:10:48 +02:00
Daniel García Aubert
edd382fb8f
Check user is the same user that sends the request when basic-auth is provided
2018-02-16 18:21:06 +01:00
Daniel García Aubert
ad772246d0
Get api_key from specific middleware and save it into res.locals
2018-02-15 17:23:35 +01:00
Simon Martín
47b6ae65f5
test escape chars function
2017-12-18 12:46:03 +01:00
Simon Martín
43598cafe6
test ensuring errors header
2017-11-28 17:19:48 +01:00
Daniel García Aubert
8012fe26aa
Avoid scan behaviour to discover active queues of user's jobs, now keeps an index to know which queues are available
2017-03-31 14:30:33 +02:00
Raul Ochoa
aa68dff24b
Use constants for tests
2016-10-12 18:44:46 +02:00
Raul Ochoa
611508c654
Hide queue seeker behind job subscriber
2016-10-11 19:01:39 +02:00
Raul Ochoa
e4b1711e8e
pub/sub package
2016-10-11 18:28:46 +02:00
Raul Ochoa
461728d3e2
Remove user indexer
2016-08-30 19:08:06 +02:00
Daniel García Aubert
ccff602bbf
Merge branch 'master' into fix-publisher-connection
2016-07-07 16:07:41 +02:00
Raul Ochoa
368fe2403e
Allow to setup more than one domain to validate oauth against
2016-07-07 14:20:36 +02:00
Daniel García Aubert
5eaad4d5d9
Uses redis-mpool for pubsub in Batch API
2016-07-07 14:14:46 +02:00
Daniel García Aubert
74d83a457e
Now batch publisher sends a ping to server before publishing and create a new connection if error.
...
Batch publisher and subscriber logs (if debug enabled) both outcoming and incoming messages to give more visibility.
2016-07-07 10:44:17 +02:00
Daniel García Aubert
a1f31df92e
Now Batch API broadcast to other APIs everytime that re-enqueues a multiple-query job
2016-06-29 18:29:53 +02:00
Daniel García Aubert
7121b3b800
Passed test
2016-04-04 20:05:58 +02:00
Daniel García Aubert
b62edcb64f
Refactored batch-api startup. Isolated code related to queue discovering, api much clear and concise.
2016-04-04 16:05:33 +02:00
dgaubert
e8a44136c5
Now Batch API looks for queues with jobs to consume at service initialization time
2016-03-31 17:37:35 +02:00
Daniel García Aubert
c540899580
Implemented unit test for user indexer in batch service
2016-01-25 10:47:21 +01:00
Daniel García Aubert
e6f714a51b
Implemented some new unit test
2016-01-22 19:31:25 +01:00
Daniel García Aubert
5c4d239467
Fixed unit test for job queue and moved isJobFound function as private method in job backend
2016-01-22 12:43:41 +01:00
Daniel García Aubert
d0787d03f7
Reused matadata backend instance for batch service
2015-12-14 10:36:16 +01:00
Raul Ochoa
5ec6d7c77b
Remove no longer needed health check params
2015-09-07 18:34:50 +02:00
Raul Ochoa
546100a950
unit tests using describe+it plus jshint fixes
2015-05-12 18:34:25 +02:00
Luis Bosque
0b63c35e85
Removed commented healthcheck tests
2015-04-06 19:04:28 +02:00
Luis Bosque
21cbdfd4a3
Disable per user health checks tests
2015-04-06 16:44:01 +02:00
Luis Bosque
6874ef823a
jshint fixes
2015-03-25 18:39:45 +01:00
Luis Bosque
897df7634b
Return failed health checks with disabled file
2015-03-25 17:15:41 +01:00
Raul Ochoa
7c62632ea8
Health check endpoint
2014-08-26 18:40:58 +02:00
Raul Ochoa
77cb86154c
Starts using cartodb-psql node module in SQL API
2014-08-11 20:15:55 +02:00