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

[Bug] Not able to find setting extension-id.title.path #861

Closed
1 task done
ashish-gawali-adi opened this issue Jun 21, 2023 · 16 comments · Fixed by #961
Closed
1 task done

[Bug] Not able to find setting extension-id.title.path #861

ashish-gawali-adi opened this issue Jun 21, 2023 · 16 comments · Fixed by #961
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ashish-gawali-adi
Copy link

**Trying to get a setting defined as extension-id.title.path, unable to do so using function **

  • Sample code used:
      const settingsEditor = await workbench.openSettings();
      const setting = await settingsEditor.findSetting(
        "Path",
        "Extension_ID",
        "Title"
      );

Steps to Reproduce

  1. Define a setting in package.json as below:
{
  "contributes": {
    "configuration": [
       {
         "title": "Miscellaneous",
         "properties": {
           "extension-id.title.path": {
            "type": "string",
            "default": null,
            "description": "Path to SDK",
            "scope": "machine-overridable",
            "order": 0
          }
         }
       }
    ]
  }
}
  1. Set the property, make sure it is not set to undefined.
  2. Define a test where you try to call the setting using the following code.
      const workbench = new Workbench();
      const settingsEditor = await workbench.openSettings();
      const setting = await settingsEditor.findSetting(
        "Path",
        "Extension-id",
        "Title"
      );
      await workbench.getDriver().sleep(10000);
      const value = await setting.getValue();

Expected behavior

  • The setting should be defined, but it shows up as undefined.

Environment information

  • OS:
    • Windows
  • VSCode version: 1.77.3
  • ExTester version: 5.5.3
  • Node (npm) version: 9.6.6
@ashish-gawali-adi ashish-gawali-adi added bug Something isn't working new-issue New issue which was not discussed yet labels Jun 21, 2023
@djelinek
Copy link
Collaborator

@ashish-gawali-adi Hello and thank you for raising the issue.

If I am correct, you are using Node 20 probably? but vscode-extension-tester is currently supporting only Node 16

Could you reproduce this problem also with Node 16?

@djelinek djelinek removed the new-issue New issue which was not discussed yet label Jun 23, 2023
@ashish-gawali-adi
Copy link
Author

I was using Node 18. I reproduced the issue with Node 16, still breaking.

@djelinek
Copy link
Collaborator

Could you paste also screenshot of settings you are trying to reach out? it should be provided by extester on failure

@djelinek
Copy link
Collaborator

so code below is not working for you right?

const setting = await settingsEditor.findSetting('Pack', 'Adi-sdk', 'Cmsis');

@ashish-gawali-adi
Copy link
Author

Could you paste also screenshot of settings you are trying to reach out? it should be provided by extester on failure

image

@ashish-gawali-adi
Copy link
Author

so code below is not working for you right?

const setting = await settingsEditor.findSetting('Pack', 'Extension-id', 'Cmsis');

Yes that would be correct.

@djelinek
Copy link
Collaborator

I am sorry but I am not able to reproduce locally so without more information about your codebase and test setup I dont know how to help more.

Note: I would give a try to use latest release of vscode-extension-tester which is 5.8.0

Our test codebase which is covering also settings editor seems to be working fine. You can take a look.

@ashish-gawali-adi
Copy link
Author

@djelinek I was trying to upgrade vscode-extension-tester to 5.8.0, I keep running into the following problem:

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\workdir\XXX\node_modules\clipboardy\index.js

Did you face a similar issue and if so, how did you resolve it?

@djelinek
Copy link
Collaborator

@ashish-gawali-adi I did not. Does it happen locally or on CI ? Did you tried to remove node_modules folder and reinstall project?

@ashish-gawali-adi
Copy link
Author

I was able to figure it out, it was due to the tsconfig.json, you need to set compilerOptions.module to Node16

@djelinek
Copy link
Collaborator

and what about the root issue? is findSetting working with latest version of extester?

@ashish-gawali-adi
Copy link
Author

ashish-gawali-adi commented Jun 29, 2023

It is working for one of the setting I have but not another, the one it is not working on, I think it might be due to the setting not being on the visible part of screen. I am trying to work on an example and will try and post a link to the project so you can have a look at the code by Wednesday at the latest.

@ashish-gawali-adi
Copy link
Author

ashish-gawali-adi commented Jul 18, 2023

Hi @djelinek, Extremely sorry for the delay. I created a github repo. You can clone the main branch, you can run yarn and then run yarn run test-ui. The test is defined in the file src/ui-test/sample-test.

@ashish-gawali-adi
Copy link
Author

Hi @djelinek any updates on this?

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@djelinek
Copy link
Collaborator

djelinek commented Oct 4, 2023

Hello @ashish-gawali-adi, I am sorry for such a late response. I had to slowdown for a while on this project so I am now catching up things here again.

anyway... thank you for your sample project. I tried locally and I was able to reproduce that test is failing because the vscode settings filter, in this case of similar naming in settings definitions, is not working very well and I was not able even manually to achieve results where I would get only one requested setting which I was looking for...

so for this cases I have implemented new method which will enable to use setting ID to filter results. I hope it will suits your needs and unlock your testing project.

@djelinek djelinek self-assigned this Oct 4, 2023
@djelinek djelinek added this to the NEXT milestone Oct 4, 2023
@djelinek djelinek linked a pull request Oct 4, 2023 that will close this issue
9 tasks
@djelinek djelinek modified the milestones: NEXT, 5.10.0 Oct 6, 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

Successfully merging a pull request may close this issue.

2 participants