Add GitHub Actions (#5522)
* add .github/workflows/nodejs.yml * fix * GitHub Actions: Node.js 8.xはサポートしない * add .github/workflows/docker.yml * Dockerビルドをキャッシュするように * Run test in github actions * 同リポジトリ内からのプルリクだと無駄に二回走るのを抑制 * 6925c00のdocker.ymlへの適応忘れ * fix .circleci/misskey/test.yml * test実行時にDBとかredisとか動かすように * fix * fix tests (#5544) * fix test * fix compile errors * PATH引き継ぎでchild_process.spawn時のENOENTを修正 * サーバー起動処理を共通化 * fix coding style * fd=4をipcに使うように * fix port * fix * fix ws port * #4033 にテストケースを追従 * fix? * fix?? * fix * fix * fix * maybe fix * fix * node 10.xサポートしてなかった * 11.10じゃないとだめだった * fix * remove chart test * fix * chart test復活 * fix * 一回一回コネクションを閉じる * Revert "一回一回コネクションを閉じる" This reverts commit 56e35cf4f83070744c8dd852f1a7075011d88828. * 一回一回sync→dropしてるのをやめてみる * fix * fix * … * キャッシュを切ってみる * add ts to require target * omg fix * Revert "キャッシュを切ってみる" This reverts commit 88161c59d2ea769ddf87143ba4fd4660a06afdf2. * done呼び忘れ * 実際の文字数リミットと違ってたので対応 * テストケースがバグってたので修正 * Revert "一回一回sync→dropしてるのをやめてみる" This reverts commit a9e543ba2eef790ac7a14ae8799b898765748e35. * fix * fix * fix * fix? * fix * chartのconnectionを分離する * fix * fix * fix tsconfig? * Revert "fix tsconfig?" This reverts commit ba9269eaf65507ff97ec1dd2e27260fb2cf0510b. * fix * TS_NODE_FILES を scripts の方で指定 * Windowsェ * Circle CIの実行条件をmasterへのpushのみに Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
16fb7c4557
commit
3ecb0ab161
17 changed files with 192 additions and 264 deletions
|
@ -17,14 +17,18 @@ process.env.NODE_ENV = 'test';
|
|||
import * as assert from 'assert';
|
||||
import * as lolex from 'lolex';
|
||||
import { async } from './utils';
|
||||
import { getConnection, createConnection } from 'typeorm';
|
||||
const config = require('../built/config').default;
|
||||
const Chart = require('../built/services/chart/core').default;
|
||||
const _TestChart = require('../built/services/chart/charts/schemas/test');
|
||||
const _TestGroupedChart = require('../built/services/chart/charts/schemas/test-grouped');
|
||||
const _TestUniqueChart = require('../built/services/chart/charts/schemas/test-unique');
|
||||
import TestChart from '../src/services/chart/charts/classes/test';
|
||||
import TestGroupedChart from '../src/services/chart/charts/classes/test-grouped';
|
||||
import TestUniqueChart from '../src/services/chart/charts/classes/test-unique';
|
||||
import * as _TestChart from '../src/services/chart/charts/schemas/test';
|
||||
import * as _TestGroupedChart from '../src/services/chart/charts/schemas/test-grouped';
|
||||
import * as _TestUniqueChart from '../src/services/chart/charts/schemas/test-unique';
|
||||
import { Connection, getConnection, createConnection } from 'typeorm';
|
||||
import config from '../src/config';
|
||||
import Chart from '../src/services/chart/core';
|
||||
import { initDb } from '../src/db/postgre';
|
||||
|
||||
function initDb() {
|
||||
function initChartDb() {
|
||||
try {
|
||||
const conn = getConnection();
|
||||
return Promise.resolve(conn);
|
||||
|
@ -51,37 +55,37 @@ describe('Chart', () => {
|
|||
let testChart: any;
|
||||
let testGroupedChart: any;
|
||||
let testUniqueChart: any;
|
||||
let connection: any;
|
||||
let clock: lolex.InstalledClock<lolex.Clock>;
|
||||
let connection: Connection;
|
||||
|
||||
before(done => {
|
||||
initDb().then(c => {
|
||||
initChartDb().then(c => {
|
||||
connection = c;
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
after(async(async () => {
|
||||
await connection.close();
|
||||
await initDb(true, undefined, undefined, true);
|
||||
}));
|
||||
|
||||
beforeEach(done => {
|
||||
const TestChart = require('../built/services/chart/charts/classes/test').default;
|
||||
testChart = new TestChart();
|
||||
|
||||
const TestGroupedChart = require('../built/services/chart/charts/classes/test-grouped').default;
|
||||
testGroupedChart = new TestGroupedChart();
|
||||
|
||||
const TestUniqueChart = require('../built/services/chart/charts/classes/test-unique').default;
|
||||
testUniqueChart = new TestUniqueChart();
|
||||
|
||||
clock = lolex.install({
|
||||
now: new Date('2000-01-01 00:00:00')
|
||||
});
|
||||
|
||||
connection.synchronize().then(done);
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(done => {
|
||||
afterEach(async(async () => {
|
||||
clock.uninstall();
|
||||
connection.dropDatabase().then(done);
|
||||
});
|
||||
await connection.dropDatabase();
|
||||
await connection.synchronize();
|
||||
}));
|
||||
|
||||
it('Can updates', async(async () => {
|
||||
await testChart.increment();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue