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

Upgrade from 4.4.0 to 5.0.0 or newer results in error #519

Closed
1 of 3 tasks
zdrapela opened this issue Oct 4, 2022 · 6 comments
Closed
1 of 3 tasks

Upgrade from 4.4.0 to 5.0.0 or newer results in error #519

zdrapela opened this issue Oct 4, 2022 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@zdrapela
Copy link

zdrapela commented Oct 4, 2022

Expected Behavior

  • Tried to bump the version of ExTester used in kie-tools from 4.4.0 to 5.0.0 (packages that use ExTester are listed bellow).
  • Similar change worked with previous versions, so no problems were expected.

Actual Behavior

  • After changing the version to 5.0.0, running integrations tests of vscode extension results in following error:
    image
  • Using latest versions of vsce and vscode-test didn't help.

Steps to Reproduce the Problem

  1. Checkout to this branch: zdrapela-patch-3 or perform these changes on main branch.
  2. cd kie-tools
  3. pnpm bootstrap
  4. pnpm -F vscode-extension-pack-kogito-kie-editors... build:dev
  5. export KIE_TOOLS_BUILD__runIntegrationTests=true
  6. pnpm -F vscode-extension-pack-kogito-kie-editors test:it

Broader description located here.
ExTester is used in following packages:

Specifications

  • VSCode version: 1.69.2 and 1.71.2 (same problem with both versions)
  • ExTester version: 5.0.0
  • Platform:
    • Linux (RHEL 8.6)
    • macOS
    • Windows
@zdrapela zdrapela added the new-issue New issue which was not discussed yet label Oct 4, 2022
@domhanak
Copy link

domhanak commented Oct 5, 2022

I guess this is relevant too - microsoft/vscode-vsce#421

@domhanak
Copy link

domhanak commented Oct 5, 2022

Read around some articles and it seems there is a viable workaround for pnpm with vsce package
I guess this line -

const cliCall = `${vscePath} package ${useYarn ? '--yarn' : '--no-yarn'}`;

should consider adding --no-dependencies when pnpm is used?

@odockal odockal self-assigned this Oct 18, 2022
@odockal odockal added bug Something isn't working and removed new-issue New issue which was not discussed yet labels Oct 18, 2022
@odockal odockal added this to the BACKLOG milestone Oct 18, 2022
@zdrapela
Copy link
Author

zdrapela commented Dec 7, 2022

The issue persists in 5.2.0

@zdrapela zdrapela changed the title Upgrade from 4.4.0 to 5.0.0 results in error Upgrade from 4.4.0 to 5.0.0 or newer results in error Dec 7, 2022
@zdrapela
Copy link
Author

zdrapela commented Dec 14, 2022

I can confirm, that workaround suggested by @domhanak works. I consider it useful to add the option to use --no-dependencies with ExTester.

There is also another workaround, that works for us. You can use package.json to tell vsce to don't use dependencies by setting the following:

{
  ...
  "vsce": {
    "dependencies": false
  }
}

I use that in this PR. This was discussed at vsce issues 439 and 742 (also mentioned in readme).

I am still not sure, why it worked before and after upgrading to 5.0.0 it stopped working. But otherwise, we can continue to use newer versions of ExTester.

@zdrapela
Copy link
Author

zdrapela commented Dec 15, 2022

The problem was caused by vsce. The vscode-extension-tester works when vsce version 2.9.2 or lower is used. In vsce version 2.9.3 a minor change was introduced, that removed the check for yarn.lock file and tried to get yarn dependencies (yarn list --prod --json) even when the yarn.lock file is not present. This if statement was removedif (await exists(path.join(cwd, 'yarn.lock'))) {...

The vscode-extension-tester version 5.0.0 contained change of vsce version from 2.3.0 to 2.11.0.

That is why we have to now disable the dependencies. By doing so, we achieve the same behavior of vsce that was previously achieved by the if statement.

Best way to reproduce usage in our repository is to use pnpm override to force use of current version of vscode-extension-tester with vsce 2.9.2 a 2.9.3 and see the difference. The override has to be used in root package.json.

"pnpm": {
	"overrides": {
		"[email protected]": "2.9.2"
	}
}

@zdrapela
Copy link
Author

zdrapela commented Jan 3, 2023

Adding the option to use --no-dependencies with ExTester would be nice to have, but since there is a viable workaround with package.json that can do the same, I am closing the issue.

@zdrapela zdrapela closed this as completed Jan 3, 2023
@zdrapela zdrapela closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants