refactor
gitea/salix/pipeline/head This commit has test failures
Details
gitea/salix/pipeline/head This commit has test failures
Details
This commit is contained in:
parent
87de2bd2fb
commit
db06626675
|
@ -35,5 +35,5 @@ ENTRYPOINT ["docker-start.sh"]
|
|||
|
||||
CMD ["mysqld"]
|
||||
|
||||
#HEALTHCHECK --interval=5s --timeout=10s --retries=200 \
|
||||
# CMD mysqladmin ping -h 127.0.0.1 -u root || exit 1
|
||||
HEALTHCHECK --interval=5s --timeout=10s --retries=200 \
|
||||
CMD mysqladmin ping -h 127.0.0.1 -u root || exit 1
|
||||
|
|
|
@ -39,8 +39,7 @@ module.exports = class Docker {
|
|||
|
||||
let runChown = process.platform != 'linux';
|
||||
|
||||
const healthCheck = `--health-cmd='mysqladmin ping --silent'`;
|
||||
const container = await this.execP(`docker run ${healthCheck} --env RUN_CHOWN=${runChown} -d ${dockerArgs} salix-db`);
|
||||
const container = await this.execP(`docker run --env RUN_CHOWN=${runChown} -d ${dockerArgs} salix-db`);
|
||||
this.id = container.stdout;
|
||||
|
||||
try {
|
||||
|
@ -54,7 +53,7 @@ module.exports = class Docker {
|
|||
this.dbConf.port = netSettings.Ports['3306/tcp'][0]['HostPort'];
|
||||
}
|
||||
|
||||
if (runChown) await this.wait();
|
||||
await this.waitForHealthy();
|
||||
} catch (err) {
|
||||
if (this.isRandom)
|
||||
await this.rm();
|
||||
|
|
|
@ -122,9 +122,6 @@
|
|||
"mysql": {
|
||||
"columnName": "expenceFk"
|
||||
}
|
||||
},
|
||||
"compression": {
|
||||
"type": "Number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
|
|
@ -66,6 +66,11 @@ describe('sale updatePrice()', () => {
|
|||
let saleUpdated = await app.models.Sale.findById(saleId);
|
||||
createdSaleComponent = await app.models.SaleComponent.findOne({where: {saleFk: saleId, componentFk: manaComponentId}});
|
||||
|
||||
console.log(manaComponentId);
|
||||
console.log(saleId);
|
||||
console.log(saleUpdated);
|
||||
console.log(createdSaleComponent);
|
||||
|
||||
expect(saleUpdated.price).toBe(price);
|
||||
expect(createdSaleComponent.value).toEqual(-2.04);
|
||||
});
|
||||
|
|
|
@ -14,16 +14,16 @@ module.exports = Self => {
|
|||
});
|
||||
|
||||
Self.getCurrentWorkerMana = async ctx => {
|
||||
let currentClientId = ctx.req.accessToken.userId;
|
||||
let currentWorker = await Self.app.models.Worker.findOne({
|
||||
where: {userFk: currentClientId},
|
||||
fields: 'id'
|
||||
});
|
||||
let currentWorkerMana = await Self.app.models.WorkerMana.findOne({
|
||||
where: {workerFk: currentWorker.id},
|
||||
let userId = ctx.req.accessToken.userId;
|
||||
|
||||
console.log(userId);
|
||||
let workerMana = await Self.app.models.WorkerMana.findOne({
|
||||
where: {workerFk: userId},
|
||||
fields: 'amount'
|
||||
});
|
||||
|
||||
return currentWorkerMana ? currentWorkerMana.amount : 0;
|
||||
let workerMana1 = await Self.app.models.WorkerMana.find();
|
||||
console.log(workerMana);
|
||||
console.log(workerMana1);
|
||||
return workerMana ? workerMana.amount : 0;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue