Skip to content
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

Fix flaky integration tests and error handling for invalid team config #3322

Merged
merged 18 commits into from
Nov 20, 2024

Conversation

t1m0thyj
Copy link
Member

@t1m0thyj t1m0thyj commented Nov 15, 2024

Proposed changes

Fix transient errors in integration tests, and upload test results in CI even when tests fail to make debugging easier.

The tests passed 10 times in a row in this workflow:
https://github.com/zowe/zowe-explorer-vscode/actions/runs/11923838338/job/33234787006

Also fixes error handling for an invalid team config file when ZE initializes, which was uncovered by fixing tests. In v3.0.3 the error notification was shown twice, and in the main branch ZE was failing to activate.

Release Notes

Milestone: 3.1.0

Changelog: Fixed an issue during initialization where the error dialog shown for a broken team configuration file was missing the "Show Config" action

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds or improves functionality)
  • Breaking change (a change that would cause existing functionality to not work as expected)
  • Documentation (Markdown, README updates)
  • Other (please specify above in "Proposed changes" section)

Checklist

General

  • I have read the CONTRIBUTOR GUIDANCE wiki
  • All PR dependencies have been merged and published (if applicable)
  • A GIF or screenshot is included in the PR for visual changes
  • The pre-publish command has been executed:
    • v2 and below: yarn workspace vscode-extension-for-zowe vscode:prepublish
    • v3: pnpm --filter vscode-extension-for-zowe vscode:prepublish

Code coverage

  • There is coverage for the code that I have added
  • I have added new test cases and they are passing
  • I have manually tested the changes

Deployment

  • I have added developer documentation (if applicable)
  • Documentation should be added to Zowe Docs
    • If you're an outside contributor, please post in the #zowe-doc Slack channel to coordinate documentation.
    • Otherwise, please check with the rest of the squad about any needed documentation before merging.
  • These changes may need ported to the appropriate branches (list here):

Further comments

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.02%. Comparing base (57db6f3) to head (86a1b4e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3322      +/-   ##
==========================================
+ Coverage   92.99%   93.02%   +0.03%     
==========================================
  Files         116      116              
  Lines       12046    12046              
  Branches     2656     2773     +117     
==========================================
+ Hits        11202    11206       +4     
+ Misses        842      839       -3     
+ Partials        2        1       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@t1m0thyj t1m0thyj added the no-changelog Add to PR's that don't require a CHANGELOG update label Nov 15, 2024
@t1m0thyj t1m0thyj marked this pull request as ready for review November 15, 2024 20:35
Copy link

github-actions bot commented Nov 15, 2024

📅 Suggested merge-by date: 12/4/2024

@t1m0thyj
Copy link
Member Author

There is another integration test (UpdateCredentials.feature) that has frequent transient failures, marking as draft until this one is fixed.

@t1m0thyj t1m0thyj marked this pull request as draft November 15, 2024 20:41
traeok
traeok previously approved these changes Nov 18, 2024
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes make sense to me, thanks @t1m0thyj for the fix
Can re-approve if needed. The UpdateCredentials test is interesting because it tries to click on the search "action button" and Selenium times out stating that the search button isn't interactable.

Signed-off-by: Timothy Johnson <[email protected]>
@pull-request-size pull-request-size bot added size/L and removed size/M labels Nov 18, 2024
@t1m0thyj t1m0thyj marked this pull request as ready for review November 18, 2024 16:02
@t1m0thyj t1m0thyj requested a review from traeok November 18, 2024 16:02
traeok
traeok previously approved these changes Nov 18, 2024
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding Codicon handling to the QuickPick page object 😋

@t1m0thyj t1m0thyj marked this pull request as draft November 18, 2024 20:15
@t1m0thyj t1m0thyj force-pushed the ci/always-upload-test-results branch from 77bf81f to 592f01d Compare November 19, 2024 14:25
@t1m0thyj t1m0thyj force-pushed the ci/always-upload-test-results branch from afe0c62 to 73cf33a Compare November 19, 2024 23:47
@t1m0thyj t1m0thyj marked this pull request as ready for review November 20, 2024 01:08
@t1m0thyj t1m0thyj requested a review from traeok November 20, 2024 01:12
@t1m0thyj t1m0thyj marked this pull request as draft November 20, 2024 03:55
Signed-off-by: Timothy Johnson <[email protected]>
@t1m0thyj t1m0thyj changed the title Upload test results in CI when there are failing tests Fix flaky integration tests and Show Config action missing for invalid team config Nov 20, 2024
@t1m0thyj t1m0thyj marked this pull request as ready for review November 20, 2024 16:02
@t1m0thyj t1m0thyj changed the title Fix flaky integration tests and Show Config action missing for invalid team config Fix flaky integration tests and error handling for invalid team config Nov 20, 2024
@t1m0thyj t1m0thyj added this to the v3.1.0 milestone Nov 20, 2024
@t1m0thyj t1m0thyj requested a review from anaxceron November 20, 2024 16:07
@t1m0thyj t1m0thyj removed the no-changelog Add to PR's that don't require a CHANGELOG update label Nov 20, 2024
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM, thanks for adding the resources dir and for fixing these issues!
Looks like the Show Config dialog had regressed at some time after #3274, as I tested w/ the merge commit from that PR and it is working as expected 😅 it might have been related to some of the preliminary changes introduced recently for handling credential management.

@@ -564,7 +565,8 @@ export class ProfilesUtils {
await ProfilesUtils.readConfigFromDisk(true);
ZoweLogger.info(vscode.l10n.t("Zowe profiles initialized successfully."));
} catch (err) {
if (err instanceof imperative.ImperativeError) {
// JSON parsing errors in team config files will have suppressDump=true
if (err instanceof imperative.ImperativeError && !err.mDetails.suppressDump) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

creative workaround for the instanceof imperative.ImperativeError check 😋
I think this makes more sense than just showing the error for all imperative errors

@zFernand0 zFernand0 merged commit 95700e2 into main Nov 20, 2024
28 checks passed
@zFernand0 zFernand0 deleted the ci/always-upload-test-results branch November 20, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants