refs #6915 test_master24_8 #2067
|
@ -101,6 +101,7 @@ pipeline {
|
|||
}
|
||||
stage('Database') {
|
||||
when { anyOf {
|
||||
branch 'dev'
|
||||
branch 'test'
|
||||
branch 'master'
|
||||
}}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/* eslint-disable no-console */
|
||||
const path = require('path');
|
||||
const Myt = require('@verdnatura/myt/myt');
|
||||
const Run = require('@verdnatura/myt/myt-run');
|
||||
let dataSources = require('../loopback/server/datasources.json');
|
||||
|
||||
let myt;
|
||||
let server;
|
||||
|
||||
process.on('warning', warning => {
|
||||
console.log(warning.name);
|
||||
|
@ -11,25 +12,33 @@ process.on('warning', warning => {
|
|||
console.log(warning.stack);
|
||||
});
|
||||
|
||||
process.on('SIGUSR2', async() => {
|
||||
if (myt) await myt.deinit();
|
||||
});
|
||||
process.on('SIGUSR2', rmServer);
|
||||
process.on('exit', rmServer);
|
||||
|
||||
process.on('exit', async function() {
|
||||
if (myt) await myt.deinit();
|
||||
});
|
||||
async function rmServer() {
|
||||
if (!server) return;
|
||||
await server.rm();
|
||||
server = null;
|
||||
}
|
||||
|
||||
async function test() {
|
||||
console.log('Building and running DB container.');
|
||||
|
||||
const isCI = process.argv[2] === 'ci';
|
||||
|
||||
myt = new Myt();
|
||||
const myt = new Myt();
|
||||
await myt.init({
|
||||
workspace: path.join(__dirname, '..'),
|
||||
random: true,
|
||||
ci: isCI,
|
||||
tmpfs: process.platform == 'linux',
|
||||
network: isCI ? 'jenkins' : null
|
||||
});
|
||||
const {dbConfig} = await myt.run(Run);
|
||||
server = await myt.run(Run);
|
||||
await myt.deinit();
|
||||
const {dbConfig} = server;
|
||||
|
||||
console.log('Initializing backend.');
|
||||
|
||||
dataSources = JSON.parse(JSON.stringify(dataSources));
|
||||
Object.assign(dataSources.vn, {
|
||||
|
@ -46,6 +55,8 @@ async function test() {
|
|||
// FIXME: Workaround to wait for loopback to be ready
|
||||
await app.models.Application.status();
|
||||
|
||||
console.log('Running tests.');
|
||||
|
||||
const Jasmine = require('jasmine');
|
||||
const jasmine = new Jasmine();
|
||||
|
||||
|
@ -81,9 +92,13 @@ async function test() {
|
|||
});
|
||||
|
||||
await jasmine.execute();
|
||||
|
||||
console.log('Stopping.');
|
||||
|
||||
if (app) await app.disconnect();
|
||||
if (myt) await myt.deinit();
|
||||
console.log('App disconnected & container removed');
|
||||
await rmServer();
|
||||
|
||||
console.log('Tests ended.\n');
|
||||
}
|
||||
|
||||
test();
|
||||
|
|
|
@ -6,9 +6,10 @@
|
|||
*/
|
||||
SET foreign_key_checks = 0;
|
||||
|
||||
-- CREATE ROLE 'salix';
|
||||
-- GRANT 'salix' TO 'root'@'%';
|
||||
-- SET DEFAULT ROLE 'salix' FOR 'root'@'%';
|
||||
DROP ROLE 'salix';
|
||||
CREATE ROLE 'salix';
|
||||
GRANT 'salix' TO 'root'@'%';
|
||||
SET DEFAULT ROLE 'salix' FOR 'root'@'%';
|
||||
|
||||
CREATE SCHEMA IF NOT EXISTS `vn2008`;
|
||||
CREATE SCHEMA IF NOT EXISTS `tmp`;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE account.roleLog DROP FOREIGN KEY roleLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE account.userLog DROP FOREIGN KEY userLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.entryLog DROP FOREIGN KEY entryLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.clientLog DROP FOREIGN KEY clientLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.itemLog DROP FOREIGN KEY itemLogItemFk;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.shelvingLog DROP FOREIGN KEY shelvingLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.workerLog DROP FOREIGN KEY workerFk;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.deviceProductionLog DROP FOREIGN KEY deviceProductionOriginFk;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.zoneLog DROP FOREIGN KEY zoneLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.rateLog DROP FOREIGN KEY rateOriginFk;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.ticketLog DROP FOREIGN KEY ticketLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.userLog DROP FOREIGN KEY userLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.routeLog DROP FOREIGN KEY routeLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.claimLog DROP FOREIGN KEY claimOriginFk;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.supplierLog DROP FOREIGN KEY supplierLog_supplierFk;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.invoiceInLog DROP FOREIGN KEY invoiceInLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.travelLog DROP FOREIGN KEY travelLog_ibfk_1;
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.packingSiteDeviceLog DROP FOREIGN KEY packingSiteDeviceLog_ibfk_1;
|
|
@ -27,6 +27,6 @@ describe('Ticket expeditions and log path', () => {
|
|||
const result = await page
|
||||
.countElement(selectors.ticketExpedition.expeditionRow);
|
||||
|
||||
expect(result).toEqual(4);
|
||||
expect(result).toEqual(6);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -41,10 +41,10 @@ describe('Supplier basic data path', () => {
|
|||
expect(result).toEqual('Plants Nick SL');
|
||||
});
|
||||
|
||||
it('should check the isSerious checkbox is now unchecked', async() => {
|
||||
it('should check the isSerious checkbox is now checked', async() => {
|
||||
const result = await page.checkboxState(selectors.supplierBasicData.isSerious);
|
||||
|
||||
expect(result).toBe('unchecked');
|
||||
expect(result).toBe('checked');
|
||||
});
|
||||
|
||||
it('should check the isActive checkbox is now unchecked', async() => {
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
|
||||
"@babel/preset-env": "^7.11.0",
|
||||
"@babel/register": "^7.7.7",
|
||||
"@verdnatura/myt": "^1.6.0",
|
||||
"@verdnatura/myt": "^1.6.3",
|
||||
"angular-mocks": "^1.7.9",
|
||||
"babel-jest": "^26.0.1",
|
||||
"babel-loader": "^8.2.4",
|
||||
|
@ -3375,9 +3375,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@verdnatura/myt": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@verdnatura/myt/-/myt-1.6.0.tgz",
|
||||
"integrity": "sha512-bQWWMTkvX4wQzojp//XmTRLFGTBuVJ+pwNZxSoIl4LjsidCq5FId48qpkFG9E/CBi3gaf7AkbYDD+A8pv1WMUQ==",
|
||||
"version": "1.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@verdnatura/myt/-/myt-1.6.3.tgz",
|
||||
"integrity": "sha512-VRoTB5sEPL8a7VaX9l2afpaPNT6pBa+If1tP9tpaJ4enFQbNITlApcC0GK6XYmWMkJQjl2lgdN4/u0UCiNb2MQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sqltools/formatter": "^1.2.5",
|
||||
|
@ -30604,9 +30604,9 @@
|
|||
}
|
||||
},
|
||||
"@verdnatura/myt": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@verdnatura/myt/-/myt-1.6.0.tgz",
|
||||
"integrity": "sha512-bQWWMTkvX4wQzojp//XmTRLFGTBuVJ+pwNZxSoIl4LjsidCq5FId48qpkFG9E/CBi3gaf7AkbYDD+A8pv1WMUQ==",
|
||||
"version": "1.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@verdnatura/myt/-/myt-1.6.3.tgz",
|
||||
"integrity": "sha512-VRoTB5sEPL8a7VaX9l2afpaPNT6pBa+If1tP9tpaJ4enFQbNITlApcC0GK6XYmWMkJQjl2lgdN4/u0UCiNb2MQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@sqltools/formatter": "^1.2.5",
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
|
||||
"@babel/preset-env": "^7.11.0",
|
||||
"@babel/register": "^7.7.7",
|
||||
"@verdnatura/myt": "^1.6.0",
|
||||
"@verdnatura/myt": "^1.6.3",
|
||||
"angular-mocks": "^1.7.9",
|
||||
"babel-jest": "^26.0.1",
|
||||
"babel-loader": "^8.2.4",
|
||||
|
|
Loading…
Reference in New Issue