Commit Graph

139 Commits

Author SHA1 Message Date
Nicholas Duffy 18cffb98ab Add connectorCapabilities global object (#201) 2016-10-11 23:13:20 -07:00
Simon Ho 8ed53f6cfa Remove unused prefix for test env vars (#203)
* TEST_ prefix is not used by CI anymore and there for serve no purpose

* Part of overall goal to standardize env var injection to
  MODULE_VARNAME (ie. MYSQL_HOST for example) convention
2016-10-07 17:36:43 -07:00
Loay 6100a62461 Add CI fixes (#197) 2016-09-28 13:32:38 -07:00
Ron Lloyd 980151d0a8 Fixing lint errors 2016-09-13 22:21:11 -06:00
Ron Lloyd 0de8dc7c97 Tests for autoupdate mysql.columnName bug fix 2016-09-13 22:21:11 -06:00
Miroslav Bajtoš a9dc15c180 Explictly set forceId:false in test model 2016-09-05 16:01:31 +02:00
Simon Ho a004b03d0f Fix pretest and init test configs
Environment variables set in pretest.js and test/init.js were silently
being converted to Strings. For example, when TEST_MYSQL_USER is
undefined, it's value was automatically converted to the String
'undefined'. This is documented a side effect of assigning values to
process.env. See https://nodejs.org/api/process.html#process_process_env
for more details
2016-08-19 10:56:19 -07:00
deepakrkris 22c1700af8 Fix to configure model index in keys field
This is a fix for issue 109,for model indexes not configured
per strongloop documentation
2016-08-15 12:51:56 -04:00
Raymond Feng 5fec12a00c Merge pull request #179 from azatoth/zero_datetime
Add special handling of zero date/time entries
2016-08-11 09:03:14 -07:00
Loay 9c9b61e7dc Update eslint infrastructure 2016-08-10 20:04:26 -04:00
Ryan Graham 2533fe8404
test: use dump of original test DB as seed 2016-08-09 19:14:51 -07:00
Ryan Graham a798377f98
test: skip cardinality, update sub_part
Index cardinality is actually a metric that is based on MySQL analyzing
the table contents, so its value here has more to do with whether the
tests are running against a new table, an old table, or whether it has
any data in it.

The Sub_part field is similarly unimportant for the purposes of these
tests since it refers to indexing internals based on data type and
partial indexing.

See: https://dev.mysql.com/doc/refman/5.5/en/show-index.html
2016-08-09 19:14:51 -07:00
Ryan Graham 3954709bbc
test: accept alternate test db credentials
Allow the tests to run on ci.strongloop.com using the credentials that
are given there, but translate them to the form that is used on
cis-jenkins, which is actually the correct format.
2016-08-09 19:00:07 -07:00
Ryan Graham cb118de2cd
test: use should for easier debugging 2016-08-09 11:25:39 -07:00
Ryan Graham b965a31f77
test: account for mysql version differences
Some of the tests are based on default behaviour of MySQL 5.5 or older
which is not the same as 5.7 out of the box.
2016-08-09 11:25:38 -07:00
Ryan Graham 45491d1d90
test: match case with example/table.sql 2016-08-09 11:25:38 -07:00
Ryan Graham 5a7cac6852
test: separate assertions from test flow control 2016-08-09 11:25:38 -07:00
Ryan Graham 9ad29ddbaa
test: update tests to use example DB
Use should.match() so we can use case-insensitve regexp for properties
that change case depending on the server being tested against.
2016-08-09 11:25:38 -07:00
Ryan Graham ebb6e68f0e
test: fix undefined password
If no password is given, '+ password' stringifies to 'undefined', which
generates a URL that has 'undefined' as the password instead of leaving
out the password.
2016-08-05 10:54:21 -07:00
Carl Fürstenberg 1ee79768f2 Add special handling of zero date/time entries
Per MySQL docs
(http://dev.mysql.com/doc/refman/5.7/en/date-and-time-types.html):

  "MySQL permits you to store a “zero” value of '0000-00-00' as a
  “dummy date.” This is in some cases more convenient than using NULL
  values, and uses less data and index space. To disallow '0000-00-00',
  enable the NO_ZERO_DATE mode.

  “Zero” date or time values used through Connector/ODBC are converted
  automatically to NULL because ODBC cannot handle such values."

As we are not using Connector/ODBC we need to handle this ourself.
2016-07-29 14:59:24 +02:00
juehou 658635e72c Add function connect 2016-05-12 15:56:48 -04:00
Ryan Graham 340a4eb0f6
insert/update copyright notices 2016-05-03 16:52:03 -07:00
juehou 12cf967b7b Override other settings if url provided
Handle url in config
Override other settings if url provided
2016-04-06 23:31:23 -04:00
Amir Jafarian 02e7c57ecd Add `connectorCapabilities ` 2016-03-30 11:53:03 -04:00
Amir Jafarian f572f920a4 Implement ReplaceOrCreate 2016-01-15 19:12:38 -05:00
cgole 58850ec24c removed console.log 2015-11-19 14:57:10 -08:00
cgole 6c3e58f932 seperate env variable for test db 2015-11-18 17:13:06 -08:00
cgole 5d95e03d3f Changed username to user 2015-11-18 15:07:03 -08:00
cgole da879ea47f Added db username password 2015-11-18 14:37:46 -08:00
cgole f255850382 Add mysql CI host 2015-11-17 13:23:52 -08:00
Simon Ho a1d78229f5 Clean up regexop tests 2015-07-29 09:46:51 -07:00
Simon Ho 1a8fb3b9fe Add regexp operator tests 2015-07-29 09:31:24 -07:00
Simon Ho 31671b5c25 Fix RegExp unit test setup/teardown 2015-07-28 17:55:27 -07:00
Simon Ho 22bebe3c4a Add support for RegExp operator 2015-07-28 17:24:31 -07:00
Raymond Feng f05aa7cfa8 Fix the failing tests 2015-05-29 08:43:26 -07:00
Raymond Feng 1bfaf1a783 Start to add transaction support 2015-05-18 12:02:25 -07:00
Raymond Feng be54c1a407 Refactor the code to use base SqlConnector 2015-05-13 10:17:15 -07:00
Raymond Feng 634a0a94bc Allow models backed by MySQL to reference mongodb ObjectID 2015-03-04 22:55:33 -08:00
Raymond Feng 2422c4c6f0 Update deps 2015-02-20 16:15:15 -08:00
Miroslav Bajtoš 0e9740fc33 Include tests of persistence hooks from juggler. 2015-02-02 19:30:33 +01:00
Raymond Feng 5b6bc9cf83 Merge pull request #54 from saggiyogesh/master
Fix for unique index when declared in fields config
2015-01-06 10:17:38 -08:00
Raymond Feng f16a8fbafd Add a test case for autoupdate 2014-12-05 11:48:34 -08:00
Raymond Feng a82fc3f9d2 Create 'NOT NULL' constraint for required or id properties 2014-12-03 14:10:21 -08:00
Raymond Feng f9caaafe37 Better handle discovery of nullable columns 2014-12-03 14:09:52 -08:00
yogesh 6d5ad5e470 (cherry picked from commit a6d31e8) 2014-10-21 11:51:45 +05:30
Raymond Feng 04c10fdf03 Enhance error reporting for automigrate/autoupdate 2014-09-11 12:23:32 -07:00
Raymond Feng abaabff01a Fix the default length for strings to avoid row size overflow 2014-07-08 11:23:45 -07:00
Raymond Feng 5236cfeeca Fix the test cases as now inq/nin is checked for array values 2014-06-26 23:48:48 -07:00
Raymond Feng 5542839c3e Map object/json to TEXT
See https://github.com/strongloop/loopback-connector-mysql/issues/36
2014-06-06 09:38:36 -07:00
Raymond Feng 51bf6e1034 Fix sql injection and add test cases 2014-05-30 15:15:27 -07:00
Raymond Feng b9e4b64848 Fix the varchar length 2014-05-29 15:45:25 -07:00
Raymond Feng 33b86b51b2 Fix object/json type mapping 2014-05-25 09:46:55 -07:00
Raymond Feng 99f9151d4f Merge pull request #21 from strongloop/feature/fix-string-id
Fix the table generation for string ids
2014-04-08 10:48:20 -07:00
Raymond Feng b0f636a4c4 Fix the query for discovery with current user
See https://github.com/strongloop/loopback-connector-mysql/issues/22
2014-04-08 08:35:39 -07:00
Raymond Feng fa003bb267 Fix the table generation for string ids 2014-04-07 22:16:26 -07:00
Raymond Feng e54aa56cee Reformat code 2014-02-12 16:57:06 -08:00
Ryan Graham a6debbcf13 Move mocha args to test/mocha.opts 2013-12-13 10:27:33 -08:00
Raymond Feng e16e67568c Add the test for loopback-datasource-juggler PR-48
https://github.com/strongloop/loopback-datasource-juggler/pull/48
2013-12-05 16:09:15 -08:00
Raymond Feng f171e74392 Improve the connector based on review feedbacks
Introduce a 'createDatabase' option to allow DB to created
Wrap the callback with connection.release
Fix typo
2013-11-27 08:42:40 -08:00
Raymond Feng 999825abea Use connection pool for MySQL 2013-11-26 17:40:31 -08:00
Raymond Feng fb2624bc6c Append error to the message 2013-11-06 14:51:20 -08:00
Raymond Feng 2a0970317a Rename ADL to LDL 2013-10-14 15:19:36 -07:00
Raymond Feng 9276025bc6 Refine the usage of rc 2013-08-23 14:31:43 -07:00
Raymond Feng 2b20ccdbd7 Use .loopback rc to load the config 2013-08-21 21:53:48 -07:00
Raymond Feng a06f4e5289 Disable console output for tests 2013-08-20 10:23:51 -07:00
Raymond Feng 9daf9ef91c Rename 'loopback-data' to 'loopback-datasource-juggler' 2013-07-30 14:21:10 -07:00
Raymond Feng 382f99b9c6 Rename schema/adapter to be dataSource/connector 2013-07-23 12:47:02 -07:00
Raymond Feng 4bedf2200c Add discovery test cases 2013-07-21 22:57:19 -07:00
Raymond Feng 9674a0308e Bring up the test cases 2013-07-21 17:27:54 -07:00
Raymond Feng 1329b40073 Start to add discovery 2013-07-20 23:38:40 -07:00
Raymond Feng 275405521b Migrate to loopback-data 2013-07-20 22:37:59 -07:00
dgsan 4bf7bcd2b3 After feedback changed Enum implementation to be a function.
The main side effect is that the `Enum` type can't be registered.
Use `EnumFactory()` to build an `Enum`.
2013-06-18 10:36:05 -07:00
dgsan c1616fd998 Support for Enum type in MySQL adapter. Requires patch to mainline JDB.
(See pull request: https://github.com/1602/jugglingdb/pull/296.)

After this there are several ways to use Enum with the adapter as shown in datatypes.test.js.
2013-06-17 14:25:57 -07:00
dgsan 6bd48f5c2e Merge branch 'master' of https://github.com/dgsan/mysql-adapter
* 'master' of https://github.com/dgsan/mysql-adapter:
  Update imported.test.js

Conflicts:
	test/imported.test.js
2013-06-13 09:40:59 -07:00
dgsan bcee504d77 Proper tests and support for connection collation/charset. Added semicov as a dev dependency because of how tests are run. 2013-06-13 09:34:31 -07:00
dgsan 543f5de835 Update imported.test.js
Wrong method of calling.
2013-06-12 15:21:52 -07:00
dgsan 193e5d6463 Adds test that validate the basic behavior of numeric and date columns using the added recently added dataTypes. 2013-06-06 10:09:39 -07:00
dgsan 93e4898312 Update migration.test.js
Global leak error triggered because of missing var in line ported from coffeescript.
2013-06-04 15:58:17 -06:00
dgsan 8b7ac18cc3 Support for local MySQL dataTypes via the dataType model field option.
Support for setting collation/charset at the schema level.

Porting of non-running migration test to new test running layout.

Resolves issue #19. Resolves issue #28. Resolves issue #17.

Should allow for changing the types for particular columns (Int, SmallInt, BigInt, Text, Char, Float, etc.).
This seems to work with the current migration test, however use of floats and such in model instances has not been heavily tested.

Likewise, in porting migration the full suite of index migration tests has yet to be ported.
Likewise, issue with dropping columns from a model persists and seems related to `defineProperty` in JDB core choking when used to try and undefine.
2013-06-04 14:34:23 -07:00
Anatoliy Chakkaev e2d41d3dd3 Mass-runner friednly test 2013-04-08 02:00:16 +04:00
Anatoliy Chakkaev b6f0c2cfc8 Split test cases 2013-04-08 01:53:55 +04:00
Anatoliy Chakkaev cd0018f3a5 Upd test runner 2013-03-27 18:15:23 +04:00
Anatoliy Chakkaev 9f063c13c5 Moved to mocha 2013-03-27 04:37:13 +04:00
Anatoliy Chakkaev f2b34378ae FIx tests 2013-03-07 03:14:41 +08:00
Anatoliy Chakkaev cfdd519f32 Update package.json 2013-03-07 02:49:06 +07:00
Anatoliy Chakkaev ec6d6e7572 Set User table name and fix test for migrations 2013-02-16 23:09:20 +08:00
dgsan ac8f882175 This adds support for indexes to automigrate() and adds a check for the indexes existence to the migration.coffee 'should run migration' test.
All unit tests continue to pass. The code snippets for adding indexes are the declarative versions of the methods used in alterTable(), so the indexes should be consistant with previous declarations/additions.
Should resolve bug #5.
As a side node, also removed the 'UNIQUE' clause from the `id` declaration as it is redundant with the 'PRIMARY KEY' declaration so far as I'm aware and results in what seems to be a second index getting maintained for no reason. (If I'm wrong about this I'd be intrested in the explanation. MySQL does have a lot of oddities.)
2013-02-14 09:37:32 -07:00
Anatoliy Chakkaev e78fab6f5b Additonal test case 2012-12-15 00:09:42 +04:00
Anatoliy Chakkaev 2eed9a6e89 Init 2012-12-14 18:01:44 +04:00