cau 9995 - 10013 fix test and update structure
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
parent
7d04404053
commit
02f99d3eb2
|
@ -0,0 +1,7 @@
|
||||||
|
[client]
|
||||||
|
enable_cleartext_plugin = ON
|
||||||
|
host = localhost
|
||||||
|
port = 3306
|
||||||
|
user = root
|
||||||
|
password = password
|
||||||
|
ssl-mode = DISABLED
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#IMPORTANT Any changes in this file are to applyed to mirror file export-data.cmd
|
|
||||||
echo "USE \`account\`;" > install/dump/dumpedFixtures.sql
|
echo "USE \`account\`;" > install/dump/dumpedFixtures.sql
|
||||||
mysqldump --defaults-file=connect.ini --no-create-info account role roleRole roleInherit >> install/dump/dumpedFixtures.sql
|
mysqldump --defaults-file=connect.ini --no-create-info account role roleRole roleInherit >> install/dump/dumpedFixtures.sql
|
||||||
echo "USE \`salix\`;" >> install/dump/dumpedFixtures.sql
|
echo "USE \`salix\`;" >> install/dump/dumpedFixtures.sql
|
|
@ -11,8 +11,7 @@ BEGIN
|
||||||
UPDATE Consignatarios SET predeterminada = FALSE
|
UPDATE Consignatarios SET predeterminada = FALSE
|
||||||
WHERE Id_cliente = NEW.Id_cliente;
|
WHERE Id_cliente = NEW.Id_cliente;
|
||||||
|
|
||||||
UPDATE Consignatarios SET predeterminada = TRUE
|
|
||||||
WHERE Id_consigna = NEW.default_address;
|
|
||||||
END IF;
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
|
@ -1,7 +1,7 @@
|
||||||
USE `account`;
|
USE `account`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: account
|
-- Host: test-db.verdnatura.es Database: account
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
-- Server version 5.6.25-4-log
|
-- Server version 5.6.25-4-log
|
||||||
|
|
||||||
|
@ -55,11 +55,11 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-02-25 8:31:26
|
-- Dump completed on 2019-03-01 13:31:23
|
||||||
USE `salix`;
|
USE `salix`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: salix
|
-- Host: test-db.verdnatura.es Database: salix
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
-- Server version 5.6.25-4-log
|
-- Server version 5.6.25-4-log
|
||||||
|
|
||||||
|
@ -103,11 +103,11 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-02-25 8:31:26
|
-- Dump completed on 2019-03-01 13:31:23
|
||||||
USE `vn`;
|
USE `vn`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: vn
|
-- Host: test-db.verdnatura.es Database: vn
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
-- Server version 5.6.25-4-log
|
-- Server version 5.6.25-4-log
|
||||||
|
|
||||||
|
@ -201,11 +201,11 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-02-25 8:31:26
|
-- Dump completed on 2019-03-01 13:31:23
|
||||||
USE `vn2008`;
|
USE `vn2008`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: vn2008
|
-- Host: test-db.verdnatura.es Database: vn2008
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
-- Server version 5.6.25-4-log
|
-- Server version 5.6.25-4-log
|
||||||
|
|
||||||
|
@ -399,11 +399,11 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-02-25 8:31:27
|
-- Dump completed on 2019-03-01 13:31:24
|
||||||
USE `bi`;
|
USE `bi`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: bi
|
-- Host: test-db.verdnatura.es Database: bi
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
-- Server version 5.6.25-4-log
|
-- Server version 5.6.25-4-log
|
||||||
|
|
||||||
|
@ -447,11 +447,11 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-02-25 8:31:27
|
-- Dump completed on 2019-03-01 13:31:24
|
||||||
USE `cache`;
|
USE `cache`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: cache
|
-- Host: test-db.verdnatura.es Database: cache
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
-- Server version 5.6.25-4-log
|
-- Server version 5.6.25-4-log
|
||||||
|
|
||||||
|
@ -485,11 +485,11 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-02-25 8:31:27
|
-- Dump completed on 2019-03-01 13:31:24
|
||||||
USE `hedera`;
|
USE `hedera`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: hedera
|
-- Host: test-db.verdnatura.es Database: hedera
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
-- Server version 5.6.25-4-log
|
-- Server version 5.6.25-4-log
|
||||||
|
|
||||||
|
@ -543,11 +543,11 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-02-25 8:31:27
|
-- Dump completed on 2019-03-01 13:31:24
|
||||||
USE `postgresql`;
|
USE `postgresql`;
|
||||||
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: db.verdnatura.es Database: postgresql
|
-- Host: test-db.verdnatura.es Database: postgresql
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
-- Server version 5.6.25-4-log
|
-- Server version 5.6.25-4-log
|
||||||
|
|
||||||
|
@ -618,7 +618,7 @@ UNLOCK TABLES;
|
||||||
|
|
||||||
LOCK TABLES `workcenter` WRITE;
|
LOCK TABLES `workcenter` WRITE;
|
||||||
/*!40000 ALTER TABLE `workcenter` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `workcenter` DISABLE KEYS */;
|
||||||
INSERT INTO `workcenter` VALUES (1,'Silla',20,861,1),(2,'Mercaflor',19,NULL,NULL),(3,'Marjales',26,20006,NULL),(4,'VNH',NULL,NULL,3),(5,'Madrid',28,2843,5),(6,'Vilassar',88,88014,2),(7,'Tenerife',NULL,NULL,10),(8,'Silla-Agrario',26,NULL,NULL);
|
INSERT INTO `workcenter` VALUES (1,'Silla',20,865,1),(2,'Mercaflor',19,NULL,NULL),(3,'Marjales',26,20006,NULL),(4,'VNH',NULL,NULL,3),(5,'Madrid',28,2843,5),(6,'Vilassar',88,88014,2),(7,'Tenerife',NULL,NULL,10),(8,'Silla-Agrario',26,NULL,NULL);
|
||||||
/*!40000 ALTER TABLE `workcenter` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `workcenter` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||||
|
@ -631,4 +631,4 @@ UNLOCK TABLES;
|
||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2019-02-25 8:31:27
|
-- Dump completed on 2019-03-01 13:31:24
|
|
@ -1,3 +1,5 @@
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE `vn`.`itemTaxCountry` AUTO_INCREMENT = 1;
|
ALTER TABLE `vn`.`itemTaxCountry` AUTO_INCREMENT = 1;
|
||||||
ALTER TABLE `vn2008`.`Consignatarios` AUTO_INCREMENT = 1;
|
ALTER TABLE `vn2008`.`Consignatarios` AUTO_INCREMENT = 1;
|
||||||
|
|
||||||
|
@ -8,7 +10,7 @@ INSERT INTO `account`.`user`(`id`,`name`, `nickname`, `password`,`role`,`active`
|
||||||
SELECT id, name, CONCAT(name, 'Nick'),MD5('nightmare'), id, 1, CONCAT(name, '@verdnatura.es')
|
SELECT id, name, CONCAT(name, 'Nick'),MD5('nightmare'), id, 1, CONCAT(name, '@verdnatura.es')
|
||||||
FROM `account`.`role`;
|
FROM `account`.`role`;
|
||||||
|
|
||||||
INSERT INTO `vn`.`worker`(`id`,`workerCode`, `firstName`, `name`, `userFk`)
|
INSERT INTO `vn2008`.`Trabajadores`(`Id_Trabajador`,`CodigoTrabajador`, `Nombre`, `Apellidos`, `user_id`)
|
||||||
SELECT id,UPPER(LPAD(role, 3, '0')), name, name, id
|
SELECT id,UPPER(LPAD(role, 3, '0')), name, name, id
|
||||||
FROM `vn`.`user`;
|
FROM `vn`.`user`;
|
||||||
|
|
||||||
|
@ -29,7 +31,7 @@ INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`,`lan
|
||||||
(111, 'Missing', 'ac754a330530832ba1bf7687f577da91', 2 , 0, NULL, 'es'),
|
(111, 'Missing', 'ac754a330530832ba1bf7687f577da91', 2 , 0, NULL, 'es'),
|
||||||
(112, 'Trash', 'ac754a330530832ba1bf7687f577da91', 2 , 0, NULL, 'es');
|
(112, 'Trash', 'ac754a330530832ba1bf7687f577da91', 2 , 0, NULL, 'es');
|
||||||
|
|
||||||
INSERT INTO `vn`.`worker`(`workerCode`, `id`, `firstName`, `name`, `userFk`)
|
INSERT INTO `vn2008`.`Trabajadores`(`CodigoTrabajador`, `Id_Trabajador`, `Nombre`, `Apellidos`, `user_id`)
|
||||||
VALUES
|
VALUES
|
||||||
('LGN', 106, 'David Charles', 'Haller', 106),
|
('LGN', 106, 'David Charles', 'Haller', 106),
|
||||||
('ANT', 107, 'Hank' , 'Pym' , 107),
|
('ANT', 107, 'Hank' , 'Pym' , 107),
|
File diff suppressed because it is too large
Load Diff
|
@ -18,11 +18,11 @@ let jasmine = new Jasmine();
|
||||||
let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
||||||
|
|
||||||
let serviceSpecs = [
|
let serviceSpecs = [
|
||||||
'./db/tests/**/*[sS]pec.js'
|
'./tests/**/*[sS]pec.js'
|
||||||
];
|
];
|
||||||
|
|
||||||
jasmine.loadConfig({
|
jasmine.loadConfig({
|
||||||
spec_dir: 'services',
|
spec_dir: 'db',
|
||||||
spec_files: serviceSpecs,
|
spec_files: serviceSpecs,
|
||||||
helpers: []
|
helpers: []
|
||||||
});
|
});
|
|
@ -183,6 +183,7 @@ describe('ticket ticketCreateWithUser()', () => {
|
||||||
params.landed,
|
params.landed,
|
||||||
params.userId
|
params.userId
|
||||||
]);
|
]);
|
||||||
|
|
||||||
stmts.push(stmt);
|
stmts.push(stmt);
|
||||||
|
|
||||||
let ticketAddressIndex = stmts.push(`SELECT addressFk FROM vn.ticket WHERE id = @newTicketId`) - 1;
|
let ticketAddressIndex = stmts.push(`SELECT addressFk FROM vn.ticket WHERE id = @newTicketId`) - 1;
|
||||||
|
@ -191,12 +192,9 @@ describe('ticket ticketCreateWithUser()', () => {
|
||||||
params.clientFk,
|
params.clientFk,
|
||||||
]);
|
]);
|
||||||
let clientDefaultAddressIndex = stmts.push(stmt) - 1;
|
let clientDefaultAddressIndex = stmts.push(stmt) - 1;
|
||||||
|
|
||||||
stmts.push('ROLLBACK');
|
stmts.push('ROLLBACK');
|
||||||
|
|
||||||
let sql = ParameterizedSQL.join(stmts, ';');
|
let sql = ParameterizedSQL.join(stmts, ';');
|
||||||
let result = await app.models.Ticket.rawStmt(sql);
|
let result = await app.models.Ticket.rawStmt(sql);
|
||||||
|
|
||||||
let ticketAddress = result[ticketAddressIndex][0];
|
let ticketAddress = result[ticketAddressIndex][0];
|
||||||
let clientDefaultAddress = result[clientDefaultAddressIndex][0];
|
let clientDefaultAddress = result[clientDefaultAddressIndex][0];
|
||||||
|
|
|
@ -355,7 +355,7 @@ async function docker() {
|
||||||
let d = new Date();
|
let d = new Date();
|
||||||
let pad = v => v < 10 ? '0' + v : v;
|
let pad = v => v < 10 ? '0' + v : v;
|
||||||
let stamp = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
let stamp = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
||||||
await execP(`docker build --build-arg STAMP=${stamp} -t salix-db ./services/db`);
|
await execP(`docker build --build-arg STAMP=${stamp} -t salix-db ./db`);
|
||||||
|
|
||||||
let dockerArgs = `--name ${containerId} -p 3306:${dbConf.port}`;
|
let dockerArgs = `--name ${containerId} -p 3306:${dbConf.port}`;
|
||||||
|
|
||||||
|
|
|
@ -84,9 +84,9 @@
|
||||||
"yaml-loader": "^0.5.0"
|
"yaml-loader": "^0.5.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dbtest": "nodemon -q services/db/tests.js -w services/db/tests",
|
"dbtest": "nodemon -q db/tests.js -w db/tests",
|
||||||
"back": "nodemon --inspect -w modules ./node_modules/gulp/bin/gulp.js back",
|
"back": "nodemon --inspect -w modules ./node_modules/gulp/bin/gulp.js back",
|
||||||
"lint": "eslint ./ --cache --ignore-pattern .gitignore",
|
"lint": "eslint ./ --cache --ignore-pattern .gitignore",
|
||||||
"docker": "docker build -t salix-db ./services/db"
|
"docker": "docker build -t salix-db ./db"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[client]
|
|
||||||
host=localhost
|
|
||||||
port=3306
|
|
||||||
user=root
|
|
||||||
password=
|
|
Loading…
Reference in New Issue