提交 261ff8cd 编写于 作者: T Tomas Vik

Merge branch 'fix-integration-test-reporting' into 'main'

test: make sure that integration test failure gets reported

See merge request gitlab-org/gitlab-vscode-extension!260
......@@ -6,8 +6,6 @@ const glob = require('glob');
const { initializeTestEnvironment } = require('./test_infrastructure/initialize_test_environment');
const { validateTestEnvironment } = require('./test_infrastructure/validate_test_environment');
validateTestEnvironment();
const getAllTestFiles = testsRoot =>
new Promise((resolve, reject) => {
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
......@@ -17,28 +15,30 @@ const getAllTestFiles = testsRoot =>
});
async function run(testsRoot) {
// Create the mocha test
const mocha = new Mocha(
process.env.CI && {
reporter: 'mocha-junit-reporter',
reporterOptions: {
mochaFile: './reports/integration.xml',
try {
validateTestEnvironment();
// Create the mocha test
const mocha = new Mocha(
process.env.CI && {
reporter: 'mocha-junit-reporter',
reporterOptions: {
mochaFile: './reports/integration.xml',
},
},
},
);
mocha.timeout(3000);
mocha.color(true);
);
mocha.timeout(3000);
mocha.color(true);
const files = await getAllTestFiles(testsRoot);
const files = await getAllTestFiles(testsRoot);
// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
// Initialize VS Code environment for integration tests
initializeTestEnvironment();
// Initialize VS Code environment for integration tests
initializeTestEnvironment();
// Run the mocha test
try {
// Run the mocha test
await new Promise((res, rej) =>
mocha.run(failures => {
if (failures) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册