-
Notifications
You must be signed in to change notification settings - Fork 92
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
Test Run Error When Using Latest Zowe Extension Version #3277
Comments
Thank you for creating a bug report. |
Let me know If you need any further information |
Hi @sujatha2206, Thanks for the bug report. I have a couple questions before moving forward with reproducing the issue:
Thanks! |
Hi @traeok |
Thanks for the quick follow up. I'm working on reproducing this issue with a sample extension and will move forward from there. One more quick question: Do you happen to have Zowe v1 profiles in place for your project, but without an available team config? It's possible that Zowe Explorer is reloading the window to handle an upgrade scenario from v1 -> v3 - unfortunately this can't be avoided since a reload is needed when upgrading from v1 to v3, but it's one possible reason why the extension is exiting. If this is the case, I would recommend setting up a team config and removing your v1 profiles to avoid this reload. |
Thanks for your quick response, I am working on testing my extension, but initially, it opens the VSCode instance and then immediately closes. If this is a profile issue, how is our development working fine? Note: My initial test case only involves getting the Zowe extension. If this were a profile issue, at least the first test case should run, right? |
Sorry if I've caused any confusion - the reason I mention this is because in Zowe Explorer, we do a reload of the window if a user is migrating from v1 to v3. This can be triggered when we detect v1 profiles, but no team configuration was detected and a v1 setting is present in your VS Code environment. Given the additional context (that your test case involves getting the Zowe extension), this may not be the cause of the issue. I'm actively working on reproducing the issue and will follow up with my results. Thanks! |
Thanks,But we don't have v1 profiles,profiles are being defined in team config, |
@sujatha2206, quick question for clarification: does your extension depend on Zowe Explorer? or does it try to download Zowe Explorer when not installed? When testing with an extension that depends on Zowe Explorer, I'm able to run tests alongside Zowe Explorer v3. I used the const zeApi = vscode.extensions.getExtension("Zowe.vscode-extension-for-zowe")?.exports as Types.IApiRegisterClient;
vscode.window.showInformationMessage(zeApi.registeredApiTypes().join(" ")); Here's the notification in action, beside the "Start all tests" message in the sample test: Here's the sample test, for reference: suite('Extension Test Suite', () => {
vscode.window.showInformationMessage('Start all tests.');
test('Sample test', async () => {
assert.strictEqual([1, 2, 3].indexOf(5), -1);
assert.strictEqual([1, 2, 3].indexOf(0), -1);
// sleep for 1sec so I can take a screenshot of the info messages
await new Promise((resolve, _reject) => setTimeout(() => resolve(null), 1000));
});
}); |
Our extension depends on zowe explorer. |
I can push the modified sample extension to a personal repo, if you'd like to test how the VS Code test CLI behaves with the sample on your machine. As it currently stands, I'm unable to reproduce the error when using a sample extension that depends on Zowe Explorer v3 - I'm able to grab its exported API and use it as normal, as well as running its tests after it initializes. Maybe this is due to an unhandled error that occurs when running tests w/ the If you have any additional errors to provide from your debug console or terminal, that might help to reproduce the issue. Is it possible to add a sleep to your extension test code, in hopes of catching any additional errors in the VS Code window before it fails and exits? |
Thanks I will look into it.please share a sample extension to my personal repo |
Here is a commit with If you clone the
|
@traeok one question If it is unhandled error how does it works in zowe 2.18 version |
If you are accessing the Zowe Explorer API using similar logic to the sample above, you should be able to use the API without issue, regardless of what Zowe Explorer version is installed. It's possible that logic during your extension's activation causes an issue with v3, specifically when running tests, but its not clear without additional context (such as a snippet of activation logic that uses the Zowe Explorer API). If possible, please provide steps to reproduce the bug outside of the context of your extension. From my testing, I am unable to reproduce the issue with the sample Zowe Explorer extender. If I change the type import in the above sample to be compatible with v2 of Zowe Explorer API, the extension tests also pass with Zowe Explorer v2.18, suggesting that it could be an extension-specific issue. |
@traeok I have now disabled the Zowe extension, and I can see that some of my test cases are successful. This may be an integration issue with my extension and Zowe. |
Hi @sujatha2206, I was just wondering if you had an update on whether you resolved your extension integration issue with Zowe Explorer v3? Thanks! |
HI @traeok issue is not resolved yet, we are still investigating it. |
Describe the bug
I am creating a test setup for my extension.My extension depends on the Zowe Explorer extension. When I use zowe: [email protected], my tests run successfully. However, when I use the latest version, the tests do not run, and I receive the following error:
Failed to run tests: TestRunFailedError: Test run failed with code 1 at ChildProcess.onProcessClosed (C:\Users\ctron\out\runTest.js:110:24)
To Reproduce
Steps to Reproduce the Behavior:
Go to the extension(IBM ZopenDebug) that depends on the Zowe extension.
Create a test setup using VS Code APIs: @vscode/test-cli and @vscode/test-electron (see: Testing Extensions).
Run: npm run test, whether using the test CLI or the advanced runner.
Observe the error: Failed to run tests: TestRunFailedError: Test run failed with code 1 at ChildProcess.onProcessClosed (C:\Users\ctron\out\runTest.js:110:24).
Expected behavior
The test cases should run successfully.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: