Commit Graph

2704 Commits

Author SHA1 Message Date
Rafa de la Torre
2773c6d23e
Merge pull request #547 from CartoDB/mockdate
Properly mock Date.now() for tests
2018-12-11 12:46:49 +01:00
Rafa de la Torre
cb5970d4a4
Merge pull request #545 from CartoDB/update-cartodb-psql
Update cartodb-psql
2018-12-11 12:03:20 +01:00
Rafa de la Torre
2f8357ee4f Properly mock Date.now() for tests 2018-12-11 11:50:53 +01:00
Rafa de la Torre
a7c0917019 Add mockdate to dev dependencies 2018-12-11 11:37:45 +01:00
Rafa de la Torre
b56f60ac4b Update package-lock.json 2018-12-10 18:23:58 +01:00
Rafa de la Torre
7502b65acb Update npm-shrinkwrap.json 2018-12-10 18:08:05 +01:00
Rafa de la Torre
eb48963d59 Update cartodb-psql 2018-12-10 17:24:53 +01:00
Rafa de la Torre
b9f647f15d Update NEWS.md #543 2018-12-07 10:31:04 +01:00
Rafa de la Torre
a3b1a38faf
Merge pull request #544 from CartoDB/max-error-header-size
Limit size of error header
2018-12-07 10:28:41 +01:00
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
Simon Martín
93c0ef4e0d
Merge pull request #542 from CartoDB/copy-quota-exceeded
cancel query when quota exceeded or max POST size
2018-11-30 10:29:01 +01:00
Simon Martín
4dbd4d8b80 tests ensuring cancel query with Quota exceeded or max POST size 2018-11-29 18:42:04 +01:00
Simon Martín
1293acca48 cancel query when Quota exceeded or max POST size 2018-11-29 18:15:14 +01:00
Daniel G. Aubert
5f5b516721
Merge pull request #540 from CartoDB/nodejs-10
Support Node.js 10 LTS
2018-11-22 14:48:55 +01:00
Daniel García Aubert
9cd485be45 Prepare next release 2018-11-22 11:45:03 +01:00
Daniel García Aubert
0c9be26011 Fix npm-shrinkwrap.json 2018-11-22 11:27:32 +01:00
Daniel García Aubert
5fb37a5d6f Update shrinkwrap 2018-11-21 19:05:55 +01:00
Daniel García Aubert
627fdc1e2c Update dependencies to released versions that support Node.js 10 2018-11-21 18:43:05 +01:00
Daniel García Aubert
bf27a8089a Merge branch 'master' into nodejs-10 2018-11-20 11:25:29 +01:00
Daniel G. Aubert
ea8ee8566c
Merge pull request #541 from CartoDB/add-memory-cpu-metrics
Add memory cpu metrics
2018-11-15 15:08:07 +01:00
Daniel García Aubert
fdaae20af7 Use let instead of var 2018-11-15 14:34:36 +01:00
Daniel García Aubert
267baf621e Send userm system, time and percent CPU metrics 2018-11-15 13:49:57 +01:00
Daniel García Aubert
e28349ff29 Send metrics about memory and CPU usage 2018-11-15 11:03:51 +01:00
Daniel García Aubert
35dd404a0b Rename lock files before installing with different versions of npm 2018-11-07 20:24:14 +01:00
Daniel García Aubert
73813063c1 Get back npm-shrinkwrap.json 2018-11-07 20:14:10 +01:00
Daniel García Aubert
35d387f25d Rename npm-shrinkwrap temporaly 2018-11-07 19:44:12 +01:00
Daniel García Aubert
348e2b386b Fix arguments in docker command 2018-11-07 19:22:13 +01:00
Daniel García Aubert
99b92c65fe Run configure before installing 2018-11-07 19:21:46 +01:00
Daniel García Aubert
721bf139b3 Install dependencies depending on the version of Node.js while running CI 2018-11-07 19:03:52 +01:00
Daniel García Aubert
3432d1b289 Get back npm-shrinkwrap.js 2018-11-07 19:03:10 +01:00
Daniel García Aubert
54343162a3 Be able run CI test agaisnt Node.js 6 and 10 2018-11-07 18:37:05 +01:00
Daniel García Aubert
70ec88eac6 Support Node.js 8 and 10 in CI tool 2018-11-07 18:06:44 +01:00
Daniel García Aubert
e0e011e806 Do not use assert to throw erros as in Node.js > 6 wraps the original error, the keyword 'throw' does the trick and it's backwards compatible 2018-11-07 18:05:39 +01:00
Daniel García Aubert
6984be4edd Use dependencies compatible with Node.js 10 2018-11-07 18:03:35 +01:00
Daniel García Aubert
22a5732580 Support package-lock.json 2018-11-07 17:10:33 +01:00
Daniel G. Aubert
91cd355c63
Merge pull request #538 from CartoDB/use-strict
Use strict mode
2018-10-26 13:48:52 +02:00
Daniel García Aubert
805a0e2346 Link released version of pg-copy-streams 2018-10-26 13:34:23 +02:00
Daniel García Aubert
2794e24e84 Use releeased version of cartodb-redis and the development branch of pg-streams 2018-10-26 13:01:04 +02:00
Daniel García Aubert
d331db5275 Update NEWS 2018-10-24 15:50:45 +02:00
Daniel García Aubert
121a19eafb Prevent: Octal literals are not allowed in strict mode. 2018-10-24 15:42:54 +02:00
Daniel García Aubert
a616982ec3 Use strict mode 2018-10-24 15:42:33 +02:00
Rafa de la Torre
cf5ad64fd4 Stub next version 2018-09-18 10:33:25 +02:00
Rafa de la Torre
0fefc16278 Update NEWS w/ release date 2018-09-18 10:11:53 +02:00
Rafa de la Torre
70a77dabe0
Merge pull request #537 from CartoDB/590-fix-copy-to-connections
Fix paused stream (DB socket) after copy to
2018-09-18 10:08:41 +02:00
Rafa de la Torre
ebac334cbd Update NEWS w/ COPY TO patch 2018-09-17 17:52:08 +02:00
Rafa de la Torre
d5a7f6d2d6 Fix paused stream (DB socket) after copy to #590
Ideally, the CopyToQueryStream would take care o piping, unpiping and
resuming the connection with the DB.

For some reason it does not always work when trying that from the
_transform callback.

Since there's no better callback (at least in node6), this patch is
required to make sure that such connection can be returned to the pool
and reused by some other query.
2018-09-17 16:54:51 +02:00
Rafa de la Torre
a927a6993a Add a test to reproduce the issue w/ COPY TO #590 2018-09-17 16:46:09 +02:00
Simon Martín
d0cd999bac
Merge pull request #536 from CartoDB/ensure-tmpDir
Ensure tmpDir
2018-08-31 10:14:18 +02:00