Commit Graph

897 Commits

Author SHA1 Message Date
Rafa de la Torre
44858df713 Add a mock for DB quota functions 2018-07-23 15:29:53 +02:00
Rafa de la Torre
fdab0136e6 Fix copy/paste test 2018-07-20 16:17:44 +02:00
Rafa de la Torre
ce409b4925 Fix typo in test describe 2018-07-20 16:09:10 +02:00
Rafa de la Torre
0f8e1f43c4 Add more tests for copy_timeout 2018-07-20 15:57:36 +02:00
Rafa de la Torre
682d7e6812 Simplify timeout tests 2018-07-20 15:38:20 +02:00
Rafa de la Torre
f437df9045 Fix timeout tests 2018-07-20 15:33:12 +02:00
Rafa de la Torre
632e6818fa Test that COPY uses db_batch_port 2018-07-20 12:04:06 +02:00
Rafa de la Torre
5b65252c4a Ensure no connection pgbouncer -> test_db #521
This is needed to make the setup a little bit more robust: when trying
to delete the test database, it won't be able if there are "idle
sessions" in the db (that is, connections from pgbouncer to the test
database).

Otherwise it fails when trying to create the database, because there's
already one with the same name.
2018-07-19 18:46:28 +02:00
Rafa de la Torre
20d1db78dc Helper to reset pgbouncer connections #521
This sends a PAUSE and RESUME to pgbouncer (in case there's one) before
and after executing tests, to make sure new connections are established
in the tests.

This may be especially important when role or session settings are
modified in the DB (same happens in prod, BTW).
2018-07-19 18:43:17 +02:00
Rafa de la Torre
6eeb949583 This is a bash script #521
And using sh can make some things fail. E.g:

```
[[: not found
```
2018-07-19 18:40:31 +02:00
Rafa de la Torre
d3e31a9d6c Allow tests to be executed against pgbouncer
pgbouncer does not support the `--client-min-messages` option. Actually
it fails connections if used like that with this somewhat cryptic
message:

```
psql: ERROR:  Unsupported startup parameter: options
```

In order to be able to execute tests against pgbouncer port (which is
desirable IMO), we either need to remove that option (with little to no
impact) or change the lines above to choose the batch API port from the
config.

Mind that this affects just test setup.
2018-07-18 15:50:57 +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
e7750eb4c8 undo remove line 2018-06-21 16:36:21 +02:00
Simon Martín
7e593bb3c9 copy to tests: cancel query with only 1 connection 2018-06-21 13:06:38 +02:00
Simon Martín
f46669fd4f details from merge 2018-06-21 12:25:19 +02:00
Simon Martín
6955d254f8 Merge branch 'master' into pgcopy-stream-refactor2-dgaubert 2018-06-21 12:19:16 +02:00
Simon Martín
dd088215c1 unify client disconnect timeout 2018-06-20 19:03:23 +02:00
Simon Martín
030a8f1ef4 checking connection reuse properly 2018-06-20 19:02:34 +02:00
Simon Martín
50da363ae0 improving name dropTableOptions 2018-06-20 18:39:17 +02:00
Simon Martín
5b87defb97 remove unneeded test table copy_endpoints_test2 2018-06-20 15:09:37 +02:00
Simon Martín
20e43f6029 ensuring query cancelation in copy from 2018-06-20 14:43:50 +02:00
Simon Martín
84c43344e4 jshgint happy 2018-06-20 13:18:32 +02:00
Simon Martín
c37ea82c0e updating copyto test making them independent 2018-06-20 11:12:19 +02:00
Simon Martín
5021c8d466 making copy test independent 2018-06-20 11:08:41 +02:00
Simon Martín
16c2fd728f js hint happy 2018-06-20 10:48:03 +02:00
Simon Martín
81e33b632d Merge branch 'master' into copyto-cancel-test 2018-06-19 15:50:46 +02:00
Daniel García Aubert
258baa3792 Remove test filter 2018-06-18 10:56:14 +02:00
Daniel García Aubert
bd499b88e5 Add tests to check copyto cancel works properly 2018-06-18 10:53:44 +02:00
Simon Martín
7dec3f4e95 jshint happy 2018-06-15 13:47:37 +02:00
Simon Martín
d4e03303f9 done after response end in test copy to 2018-06-14 18:25:38 +02:00
Simon Martín
0757d11bd0 more deterministic tests when client disconnects 2018-06-14 18:10:41 +02:00
Simon Martín
34c0c5c738 removing console log 2018-06-14 10:48:00 +02:00
Simon Martín
2fa5e7b84a grouping all copy related tests in a describe 2018-06-14 10:44:57 +02:00
Simon Martín
d67cf2f7d5 removing only 2018-06-12 16:53:37 +02:00
Simon Martín
a00891ff98 grouping all the copy tests in one describe 2018-06-12 16:46:54 +02:00
Simon Martín
8a15b2f8d1 Merge branch 'master' into pgcopy-stream-refactor2 2018-06-12 15:21:28 +02:00
Rafa de la Torre
fc12917938 Please jshint 2018-06-11 19:26:40 +02:00
Rafa de la Torre
b1073dc401 Test for the COPY FROM + disconnect 2018-06-11 19:17:23 +02:00
Rafa de la Torre
66664de286 Make the test far more robust 2018-06-11 19:04:33 +02:00
Rafa de la Torre
1417dedfd3 Final touches for client disconnect test 2018-06-11 18:45:12 +02:00
Rafa de la Torre
62fe8abd0a A much cleaner test 2018-06-11 18:38:18 +02:00
Rafa de la Torre
4b6ee133df Mess a little with the timeouts 2018-06-11 18:18:44 +02:00
Rafa de la Torre
52590faeac Add a test for client disconnection scenarios 2018-06-11 17:28:53 +02:00
Simon Martín
1174499dcf Merge branch 'master' into pgcopy-stream 2018-06-11 14:38:52 +02:00
Simon Martín
8e8ccc9c67 removing old metrics in copy 2018-06-08 13:33:17 +02:00
Eneko Lakasta
3891d93b8d remove unnecessary require 2018-06-05 17:59:46 +02:00
Eneko Lakasta
4993f8a956 use job configuration instead of user metadata service in test 2018-06-05 17:56:29 +02:00
Eneko Lakasta
03e484c5da FIX tests. Create jobs should return 403 if auth fails 2018-06-05 15:49:15 +02:00
Eneko Lakasta
06282b61fb refactor authenticatedRequest to masterRequest 2018-06-05 13:22:43 +02:00
Eneko Lakasta
eab3d289b6 refactor authenticated to authorizationLevel 2018-06-05 13:21:56 +02:00
Simon Martín
a8ccacbc09 size returns to unzipped 2018-06-05 13:16:01 +02:00
Rafa de la Torre
d2c0e68a78
Merge pull request #497 from CartoDB/cancel-copy-to-client-disconnect
Cancel copy to upon client disconnect
2018-06-05 09:59:49 +02:00
Simon Martín
2f2dcfd762 fix copy format case 2018-06-04 18:15:28 +02:00
Rafa de la Torre
4022fb2967 Clean up before executing the copy suite
So that it can be executed saving a bit of setup/teardown time:

  test/run_tests.sh --nodrop --nocreate test/acceptance/copy-endpoints.js
2018-06-04 15:46:52 +02:00
Eneko Lakasta
8515c2cc31 use job configuration instead of user metadata service 2018-06-04 11:28:59 +02:00
Simon Martín
b05ded92aa db connections usage test 2018-06-01 11:26:28 +02:00
Eneko Lakasta
46e3a87f41 add some auth TODOs 2018-05-30 18:15:35 +02:00
Eneko Lakasta
cf8bf6e5e6 get DB configuration from job instead from metadata in Job Canceller 2018-05-30 17:36:55 +02:00
Eneko Lakasta
60beea19d7 add default public fallback tests 2018-05-30 13:28:50 +02:00
Eneko Lakasta
6e3eb8ef28 Fix test: add auth params to job 2018-05-30 11:48:15 +02:00
Simon Martín
5f8533bf99 get the size gzipped 2018-05-29 16:19:06 +02:00
Eneko Lakasta
017dc69c02 add auth params to test. Is this OK? 2018-05-28 17:38:04 +02:00
Eneko Lakasta
ef9a5aeb20 FIX: use proper database public test user in api keys 2018-05-28 15:54:48 +02:00
Simon Martín
3cf28bb7ff jshint happy 2018-05-25 18:50:56 +02:00
Simon Martín
22caa049ee StreamCopyMetrics 2018-05-25 18:47:41 +02:00
Simon Martín
e2bba967f9 handling copyto errors 2018-05-24 19:48:24 +02:00
Simon Martín
3d8f45afd8 going red 2018-05-24 19:08:35 +02:00
Simon Martín
5ba7dca79c copyfrom metrics to kibana 2018-05-23 10:30:37 +02:00
Paul Ramsey
8dd1d5babf Try and quiet multipart query 2018-05-22 15:24:19 -04:00
Paul Ramsey
a4654f82b2 Merge branch 'pgcopy-stream' of github.com:CartoDB/CartoDB-SQL-API into pgcopy-stream-q 2018-05-22 10:37:50 -04:00
Paul Ramsey
ed696a96ec Merge branch 'pgcopy-stream' of github.com:CartoDB/CartoDB-SQL-API into pgcopy-stream-q 2018-05-22 10:23:04 -04:00
Simon Martín
bfeea58268 copyFrom metrics to statsd tests 2018-05-22 16:07:04 +02:00
Simon Martín
30cb88c3f9 test for copyto without sql 2018-05-22 15:56:04 +02:00
Simon Martín
e347985465 changing query parameter name from sql to q
unify query validatrion
2018-05-22 15:42:57 +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
79383bb119 removing only 2018-05-22 11:57:10 +02:00
Simon Martín
433bd01c27 copyto metrics 2018-05-22 11:54:10 +02:00
Simon Martín
81be15fbc3 adding format to copy metrics 2018-05-21 19:13:44 +02:00
Paul Ramsey
64fc0c32e3 Change from 'sql' as query parameter to 'q', aping existing sql api 2018-05-21 07:47:16 -07:00
Simon Martín
bf4d12868b Merge branch 'master' into pgcopy-stream 2018-05-18 10:57:32 +02:00
Eneko Lakasta
e85994293b remove fallback tests and refactor some http errors 403 -> 401 2018-05-17 17:13:00 +02:00
Simon Martín
d970742860 removing uneeded param 2018-05-11 14:10:52 +02:00
Simon Martín
791967877c addining gzip support to copyfrom 2018-05-11 13:33:54 +02:00
Simon Martín
85528459b8 updating tests 2018-05-11 10:38:04 +02:00
Paul Ramsey
f0021264d2 Change from form-multipart to POST with chunked upload 2018-05-10 12:11:55 -07:00
Simon Martín
40c7878da9 improve test message 2018-05-08 18:38:57 +02:00
Simon Martín
a2d0163ece ensuring works with sql parameter in query string 2018-05-08 12:51:52 +02:00
Simon Martín
fa0584e40a adding error tests 2018-05-04 16:47:02 +02:00
Simon Martín
6939b54ac4 jshint happy 2018-05-04 15:27:56 +02:00
Simon Martín
db3984021c ensuring query via multipart 2018-05-04 10:50:14 +02:00
Simon Martín
d19d236d24 test of copyto 2018-05-03 18:46:16 +02:00
Simon Martín
41a585d761 test of copyfrom 2018-05-03 18:32:39 +02:00
Simon Martín
7e71f8dc3b supporting multipart requests 2018-05-03 18:32:15 +02:00
Simon Martín
ac98f5646e EOF line 2018-04-27 17:40:13 +02:00
Simon Martín
aa80cc3328 configure environment file in travis 2018-04-27 16:38:36 +02:00
Simon Martín
a0c2a98f9f symplify run_tests_docker.sh and move it to test 2018-04-27 16:12:47 +02:00
Simon Martín
5f8e1d8f53 fix validatePGEntitiesAccess access 2018-04-26 10:13:03 +02:00
Simon Martín
ff2225ee36 removing no sense tests 2018-04-24 17:24:13 +02:00
Simon Martín
ebbdbed836 EOF line 2018-04-24 15:56:35 +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
b9295245d3 testing by authorized level 2018-04-24 13:22:15 +02:00
Simon Martín
43e08a6681 adding tests 2018-04-24 10:10:09 +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
Simon Martín
cdeb8b8e63 make EnekoLinter happy xD 2018-03-27 15:49:38 +02:00
Simon Martín
1f5e00e656 bad merge 2018-03-27 15:46:58 +02:00
Simon Martín
b75334f1e7 Merge branch 'master' into limits-error-refactor 2018-03-27 15:32:24 +02:00
Simon Martín
4f4ec1856a Merge branch 'master' into finalDetails 2018-03-27 14:56:04 +02:00
Simon Martín
84af567577 run with local files insterad of download and by OS 2018-03-27 12:23:29 +02:00
Simon Martín
bb929bf3dc adding rediscell files for linux and mac 2018-03-27 12:14:28 +02:00
Simon Martín
483c263f61 adding and testing limits error response with params 2018-03-26 19:10:23 +02:00
Simon Martín
54876fa203 addind properties to limits errors 2018-03-26 15:56:50 +02:00
Simon Martín
26baaf6081 removing retry after when no necessary 2018-03-23 15:09:16 +01:00
Simon Martín
d3959bd024 change redis cell file path 2018-03-15 12:10:23 +01:00
Simon Martín
a5ddb83b36 using curl instead of wget 2018-03-15 11:54:02 +01:00
Simon Martín
62414ec34e download redis-cell lib during tests 2018-03-15 11:42:13 +01:00
Simon Martín
581bd0dd89 Merge branch 'master' into rateLimits 2018-03-14 12:47:45 +01:00
Simon Martín
1ffeb456e8 Headers following rfc6648 2018-03-14 12:17:26 +01:00
Simon Martín
4ca34cad95 removing logs 2018-03-13 12:01:51 +01:00
Eneko Lakasta
2ec767c1fc Set Vary Header to honor Authorization header when caching (fastly) 2018-03-13 11:59:07 +01:00
Simon Martín
4c7afd4aeb installing libc6 2018-03-13 09:54:32 +01:00
Simon Martín
41db3050a7 removing precompiling rediscell, compiling on the fly 2018-03-12 20:30:54 +01:00
Simon Martín
a85aefb80c show error log 2018-03-12 19:56:55 +01:00
Simon Martín
121d96a824 list directory 2018-03-12 19:48:37 +01:00
Simon Martín
24465270b9 redis info before run 2018-03-12 19:38:55 +01:00
Simon Martín
5c97777c4a redis-cell path 2018-03-12 11:22:56 +01:00
Simon Martín
cdfeee7247 redis-cell compiled on the fly and saved to tmp folder 2018-03-05 18:23:23 +01:00
Simon Martín
488ceac73d check current path 2018-03-05 16:17:49 +01:00
Simon Martín
250df81265 removing unused var 2018-03-05 16:17:04 +01:00
Simon Martín
32f35e9d45 redis-cell path 2018-03-05 16:01:27 +01:00
Simon Martín
35ffa06b74 using cartodb-redis in rate limit tests 2018-03-03 15:02:08 +01:00
Simon Martín
755cc6cf4a adding new version of cartodb-redis 2018-03-03 15:01:27 +01:00
Simon Martín
e613708752 changing redis-cell library path reference 2018-03-02 21:00:38 +01:00
Simon Martín
5ae9eaa781 change assertRequest function name 2018-03-02 20:16:58 +01:00
Simon Martín
83c5b81d4e refactoring rate limit test 2018-03-02 20:14:10 +01:00
Simon Martín
060a43d10d removing done from synchronous tests 2018-03-02 20:02:17 +01:00
Simon Martín
4161f9fe84 previous comment 2018-03-02 16:43:01 +01:00
Simon Martín
86bfa8228f adding rate limit tests 2018-03-02 13:18:19 +01:00
Simon Martín
41875c6281 fix path of redis-cell on tests 2018-03-02 13:16:04 +01:00
Daniel García Aubert
418ec1304f Fix issue with auth fallback, it wasn't authenticated when apikey master was provided 2018-02-26 18:13:49 +01:00
Daniel García Aubert
cf0214f5c3 Respond with 403 intead of 401 when the request has no permissions to the specific resource 2018-02-23 15:50:23 +01:00
Daniel García Aubert
3807d9f94d Template for User not found error 2018-02-22 17:49:02 +01:00
Daniel García Aubert
28a7cf9259 Don't authenticate when default_public api-key is provided 2018-02-21 11:14:31 +01:00