-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terminal long running code without indication of where #2320
Comments
Hi @TheTiGuR, Could you please share Regarding to CesiumJS, does |
The above diagnostics IS the report. The error mentioned shows up in the console (which I unfortunately won't be able to get until tomorrow. Yes, ng test has no cesium related errors (Cesium is imported as part of the script section in the text configuration) |
Apparently the issue is related to CesiumJS errors. Could you please change your wallaby.js config in the following way and see if the issue is reproducible? The following config changes should fix CesiumJS errors and hopefully module.exports = function (wallaby) {
const wallabyWebpack = require('wallaby-webpack');
const path = require('path');
const fs = require('fs');
const specPattern = '/**/*spec.ts';
const angularConfig = require('./angular.json');
const projects = Object.keys(angularConfig.projects)
.map(key => {
return { name: key, ...angularConfig.projects[key] };
})
.filter(project => project.sourceRoot)
.filter(
project =>
project.projectType !== 'application' ||
(project.architect &&
project.architect.test &&
project.architect.test.builder === '@angular-devkit/build-angular:karma')
);
const applications = projects.filter(project => project.projectType === 'application');
const libraries = projects.filter(project => project.projectType === 'library');
const tsConfigFile = projects
.map(project => path.join(__dirname, project.root, 'tsconfig.spec.json'))
.find(tsConfig => fs.existsSync(tsConfig));
const tsConfigSpec = tsConfigFile ? JSON.parse(fs.readFileSync(tsConfigFile)) : {};
const compilerOptions = Object.assign(
require('./tsconfig.json').compilerOptions,
tsConfigSpec.compilerOptions
);
compilerOptions.emitDecoratorMetadata = true;
return {
files: [
'!**/*.min.js',
{ pattern: path.basename(__filename), load: false, instrument: false },
...projects.map(project => ({
pattern: project.sourceRoot + '/**/*.+(ts|js|css|less|scss|sass|styl|html|json|svg)',
load: false
})),
...projects.map(project => ({
pattern: project.sourceRoot + specPattern,
ignore: true
})),
...projects.map(project => ({
pattern: project.sourceRoot + '/**/*.d.ts',
ignore: true
})),
++ {
++ pattern: 'node_modules/cesium/Build/Cesium/Widgets/widgets.css',
++ instrument: false
++ },
++ {
++ pattern: 'node_modules/cesium/Build/Cesium/Cesium.js',
++ instrument: false
++ }
],
tests: [
...projects.map(project => ({
pattern: project.sourceRoot + specPattern,
load: false
}))
],
testFramework: 'jasmine',
compilers: {
'**/*.ts': wallaby.compilers.typeScript({
...compilerOptions,
getCustomTransformers: program => {
return {
before: [
require('@ngtools/webpack/src/transformers/replace_resources').replaceResources(
path => true,
() => program.getTypeChecker(),
false
)
]
};
}
})
},
preprocessors: {
/* Initialize Test Environment for Wallaby */
[path.basename(__filename)]: file => `
import '@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
++ window['CESIUM_BASE_URL'] = '/assets/cesium/';
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());`
},
middleware: function (app, express) {
const path = require('path');
applications.forEach(application => {
if (
!application.architect ||
!application.architect.test ||
!application.architect.test.options ||
!application.architect.test.options.assets
) {
return;
}
application.architect.test.options.assets.forEach(asset => {
-- app.use(asset.slice(application.sourceRoot.length), express.static(path.join(__dirname, asset)));
++ if (typeof asset === 'string') {
++ app.use(asset.slice(application.sourceRoot.length), express.static(path.join(__dirname, asset)));
++ } else {
++ app.use(asset.output, express.static(path.join(__dirname, asset.input)));
++ }
});
});
},
env: {
kind: 'chrome'
},
postprocessor: wallabyWebpack({
entryPatterns: [
...applications
.map(project => project.sourceRoot + '/polyfills.js')
.filter(polyfills => fs.existsSync(path.join(__dirname, polyfills.replace(/js$/, 'ts')))),
path.basename(__filename),
...projects.map(project => project.sourceRoot + specPattern.replace(/ts$/, 'js'))
],
module: {
rules: [
{ test: /\.css$/, loader: ['raw-loader'] },
{ test: /\.html$/, loader: 'raw-loader' },
{
test: /\.ts$/,
loader: '@ngtools/webpack',
include: /node_modules/,
query: { tsConfigPath: 'tsconfig.json' }
},
{ test: /\.styl$/, loaders: ['raw-loader', 'stylus-loader'] },
{ test: /\.less$/, loaders: ['raw-loader', { loader: 'less-loader' }] },
{
test: /\.scss$|\.sass$/,
loaders: [
{ loader: 'raw-loader' },
{ loader: 'sass-loader', options: { implementation: require('sass') } }
]
},
{ test: /\.(jpg|png|svg)$/, loader: 'raw-loader' }
]
},
resolve: {
extensions: ['.js', '.ts'],
modules: [
wallaby.projectCacheDir,
...(projects.length
? projects
.filter(project => project.root)
.map(project => path.join(wallaby.projectCacheDir, project.root))
: []),
...(projects.length
? projects
.filter(project => project.sourceRoot)
.map(project => path.join(wallaby.projectCacheDir, project.sourceRoot))
: []),
'node_modules'
],
alias: libraries.reduce(
(result, project) => {
result[project.name] = path.join(wallaby.projectCacheDir, project.sourceRoot, 'public-api');
-- // result = Object.assign(
-- // {
-- // cesium: path.join(wallaby.projectCacheDir, 'node_modules/cesium/Build/Cesium/Cesium')
-- // },
-- // result
-- // );
return result;
},
{},
-- { cesium: path.join(wallaby.projectCacheDir, 'node_modules/cesium/Build/Cesium') }
)
}
}),
setup: function () {
window.__moduleBundler.loadTests();
}
};
}; Please note that CesiumJS is a heavy library, and if you're not mocking it in your tests, it may significantly slow the tests down. |
Cesium errors are gone, so your fix there worked for me, thanks! I don't actually have any tests other than component created for anything using Cesium at the moment, but yes, it would be mocked. As for the long running problem, it is still happening, but seems to progress slightly past it, but still without getting to a usable state:
Previously, once the missing callback error was given, it didn't proceed past it, so the 150 tests line is progress, but the actual use within vscode is not happening and the web ui shows Nothing Found. The current diagnostics report:
|
So I spent a fair bit of time working on other branches and doing other test work just using Karma. Another branch was working, and then merging in previously non-working branches, it's all working again. I DO have a couple of long-running tests, but they report as such, not just getting stuck. I'm going to leave this open in case it pops back up, but will close in a couple days if it seems to remain stable. Thanks for the help with Cesium! |
Closing this issue. If you have further problems, please either create a new issue or else reply to this thread and we will re-open. |
Issue description or question
Wallaby has been working, but started getting stuck and while it seems to be running, no tests show up on the web view and the console shows:
There has been some variation where that line also indicated a test, and since I'm working on project without much beyond default tests I added more useful names to everything, but am now back to 'one of your tests', which isn't super useful.
Angular 7 - so no auto-config
As a secondary issue, if there is any suggestion you might have on getting Cesium referenced/loaded correctly, I would appreciate pointers there as well. Thanks!
Wallaby diagnostics report
The text was updated successfully, but these errors were encountered: