Commit Graph

561 Commits

Author SHA1 Message Date
Brian M. Carlson
3867851341 Make cancel query tests pass 2014-10-09 21:12:17 -04:00
Brian M. Carlson
dd2e71ce97 Fix max connection tests 2014-10-07 00:47:35 -04:00
Brian M. Carlson
75473221e7 Print out unfired function 2014-10-01 19:03:24 -04:00
Brian M. Carlson
c5d4207aac Fix a few more failing tests 2014-09-23 18:57:20 -04:00
Brian M. Carlson
e99f8d59a6 Remove test skip 2014-09-14 21:14:24 -04:00
Brian M. Carlson
d2bb532d73 Make moar tests pass 2014-09-14 21:11:51 -04:00
Brian M. Carlson
667c528ea6 Work towards more tests passing 2014-09-14 01:23:02 -04:00
Brian M. Carlson
b325971fdf Make more tests pass 2014-09-13 22:37:30 -04:00
Brian C
732e720d54 Merge pull request #608 from gurjeet/misc_unit_test_improvements
Miscellaneous improvements in unit tests.
2014-07-06 19:25:27 -04:00
Gurjeet Singh
ef40b6f3e9 Re-add the test for SELECT tag; I was wrong in my assumption.
Postgres generally does not emit a SELECT tag after a SELECT query, but
it does emit that tag after a CREATE TABLE x AS SELECT query.

Example:

postgres=# create table t as select 1;
SELECT 1
2014-06-22 08:19:26 -04:00
Gurjeet Singh
23b29c9846 Update a test to pass. 2014-06-17 09:15:14 -04:00
Gurjeet Singh
6530ce27fe Miscellaneous improvements in unit tests.
End statements with semicolons, to be consistent with the surrounding
code.

Added a new unit test to ensure environment variables are honored when
parsing a
connection string.

Added a TODO to cleanup a test that emits messages using console.log().

Correct a query's syntax. Looks like a good thing to do even though the
syntax
doesn't matter in mocked out tests.

Removed a test that tests for SELECT tags; AFAIK, SELECT commands don't
emit a
tag.
2014-06-15 17:33:23 -04:00
Gurjeet Singh
75760c4aa2 Improve unit tests of escape-literal/identifier, and remove them from integration tests.
Improve the code and clarity of unit tests in escape-tests.js. And
removed the related integration tests since it has been demonstrated in
the unit tests that a connection is not needed for escaping the literals
and identifiers.
2014-06-15 17:09:34 -04:00
Marek
47b0aafa6d Make sure 'end' is emitted even if no connection has ever happened 2014-05-13 12:57:01 +01:00
Brian C
740d0a6c04 Merge pull request #577 from letsface/bump-aws-tests-timeout
bump up timeout for tests against AWS from 5s to 15s
2014-05-02 08:08:08 -05:00
Ricky Ng-Adam
8fb28c5cfe test timeout value modifiable globally with TEST_TIMEOUT env variable 2014-05-02 12:32:15 +08:00
Ricky Ng-Adam
1345516117 bump up timeout for tests against AWS from 5s to 15s 2014-04-25 13:49:18 +08:00
Ricky Ng-Adam
4de8f04c34 count reuse of each connection as client.poolCount 2014-04-25 13:10:16 +08:00
Ricky Ng-Adam
fbedaf4587 capture error message from intermittent failure of copy-tests.js 2014-04-24 08:55:00 +08:00
Ricky Ng-Adam
6216f6089f test to reproduce behavior of issue brianc/node-postgres#549
a fix was provided in 5079c1e0c41f431ac2e02c40ebd875d8fbb34004;
test is modeled on query-error-handling-tests.js;
test both kill query and disconnection on prepared statement execution;
make connection error string message consistent between native and non-native;
disable test server-side kill for native as it hangs;
sync can cause error to be emitted so we catch that;
we also move _ending state before _send is called.
2014-04-24 08:36:54 +08:00
Brian C
1047aeb3c2 Merge pull request #571 from letsface/ended-event-on-pool-drained
emit event 'ended' on pool drained
2014-04-22 16:27:57 -05:00
Ricky Ng-Adam
0882c8da02 from ended to end 2014-04-18 23:30:45 +08:00
Ricky Ng-Adam
382d6d66f9 emit event when all pool are actually destroyed 2014-04-17 16:18:49 +08:00
Philipp Borgers
732fb7cc61 do not abuse label as comment in test-case 2014-04-16 19:02:54 +02:00
Brian M. Carlson
bd74d48791 Fix query error emit on native bindings 2014-04-06 12:55:26 -05:00
Brian M. Carlson
357b64d704 Remove query emit 'end' event when query has error
Closes #547
2014-04-06 11:53:47 -05:00
Brian C
f3fc6ff705 Merge pull request #546 from CartoDB/2.11-ensure-connect-callback
Ensure connect callback is invoked on premature socket hangup
2014-04-06 11:18:23 -05:00
Sandro Santilli
e72aff4cfb Have stream emit 'close' rather than 'end' for sake of testing 2014-04-04 16:11:44 +02:00
Nikhil Benesch
619ba46ffe pass prepareValue hook to toPostgres
Pass `toPostgres` type-coercers a reference to the `prepareValue`
function to ease constructing literals composed of other Postgres types.
2014-04-03 10:28:02 -04:00
Nikhil Benesch
6ced524390 allow type-coercion overrides for custom objects
Attempt to call a `toPostgres` method on objects passed as query values
before converting them to JSON. This allows custom types to convert
themselves to the appropriate PostgreSQL literal.

This strategy is fully backwards-compatible and uses the same pattern as
the `toJSON` override.
2014-03-30 20:39:56 -04:00
Nikhil Benesch
c41eedc3e0 properly prepare complex arrays
`arrayString` duplicated too much of `prepareValue`'s logic, and so
didn't receive bugfixes for handling dates with timestamps. Defer to
`prepareValue` whenever possible.

This change enforces double-quote escaping of all array elements,
regardless of whether escaping is necessary. This has the side-effect of
properly escaping JSON arrays.
2014-03-30 19:12:18 -04:00
Nikhil Benesch
b778f2bdf0 utils-tests: add unit tests for prepareValue 2014-03-30 19:03:24 -04:00
Sandro Santilli
d21b995726 Enable the test for #534 (needs special naming)
This time, I hope, travis will confirm that the fix works with
node-0.10 but not with node-0.8
2014-03-18 13:36:57 +01:00
Sandro Santilli
e19235838d Add unit test for callback on early postgresql disconnect
Test adapted by that provided by Jess Sheneberger in #534
2014-03-18 13:19:07 +01:00
Sandro Santilli
7f4351293c Do not assume PGPORT env variable is unset during testing 2014-03-18 10:06:15 +01:00
Brian M. Carlson
779c8064f2 Add domain support to connection pool 2014-03-15 16:41:33 -05:00
Brian M. Carlson
0254fa565f Add test for pg.types interface 2014-03-15 15:41:36 -05:00
Brian M. Carlson
876abe8730 Break type parsing into separate module 2014-03-15 15:36:27 -05:00
Brian M. Carlson
f63476b7b8 Adjust test to ensure DATE data-type is converted to local time 2014-03-14 06:37:00 -05:00
Brian C
2716f95257 Merge pull request #514 from benighted/parse-date-as-local
Parse date type as local time
2014-02-26 06:16:12 -06:00
Brian C
ff8fb616f6 Merge pull request #501 from lalitkapoor/GH-452
improve support for int arrays and float arrays
2014-02-26 06:15:35 -06:00
Brian M. Carlson
bf0c4bfaa9 Merge branch 'pull/326'
Conflicts:
	lib/connection-parameters.js
	test/unit/connection-parameters/creation-tests.js
2014-02-26 06:10:15 -06:00
Michael Payne
b81a60a260 Parse date type as local time 2014-01-26 10:43:15 -05:00
Brian M. Carlson
5f592a1240 Fix exception caused by column names with single quotes
Also rename some test files so they match the Makefile regex.  They will be included in the test suite from now on.
2014-01-22 08:38:29 -06:00
Lalit Kapoor
f1c0abab75 test array/float8 2014-01-08 01:00:03 -06:00
Lalit Kapoor
9bd88f8449 test array/float4 2014-01-08 00:14:42 -06:00
Lalit Kapoor
eee21dd088 test array/int8 2014-01-08 00:13:52 -06:00
Lalit Kapoor
6410a8aca2 test array/int4 2014-01-08 00:13:16 -06:00
Lalit Kapoor
0939490033 test array/int2 2014-01-08 00:12:31 -06:00
Hannes Hörl
4f00e5ab1a typo 2014-01-05 18:29:30 +01:00