xjsender / haoide

Stop upgrade, most of features were delivered in https://github.com/xjsender/haoide-vscode
MIT License
199 stars 46 forks source link

HTTP Method 'GET' not allowed. #128

Open fenixjke opened 8 years ago

fenixjke commented 8 years ago

Hi, I got an error when I tried to run sync test for salesforce (command + shift + U): errorCode: METHOD_NOT_ALLOWED Time Stamp: 2016-06-21 17:36:30 message: HTTP Method 'GET' not allowed. Allowed are POST

xjsender commented 8 years ago

@fenixjke , how to replicate it?

superdave7380 commented 8 years ago

Hey, I also get the error whenever I run to run a sync test. When on test class, right-click > Haoide > Run Sync Test Happens every time.

Thanks!

xjsender commented 8 years ago

@superdave7380 , yes, I also replicate this issue caused by new feature of v37.0, you can decrease the api version to avoid this problem.

superdave7380 commented 8 years ago

As always, thanks very much for the speedy reply.

aitiancai commented 6 years ago

change api_version to 35 in Setting-user。

scolladon commented 6 years ago

@xjsender I would like to reopen this issue because there are multiple changes after metadata API 37 (in picklist per exemple) and I do not want to switch api version each time I test a class. Furthermore, this change in the API is not going to be reverted with new releases. It will be much more easier for the end user if the feature adapt its http method with the selected api version

rspurrell commented 6 years ago

I would like this issue addressed as well for all of the same reasons that @scolladon mentioned.

adashko commented 6 years ago

I would like this issue addressed as well for all of the same reasons that @scolladon mentioned.

Sync test working (after your fix), but 'View Code Coverage' - not. 'No code coverage cache, please execute Run Sync Test on related test class before view code coverage'

rspurrell commented 6 years ago

I would like this issue addressed as well for all of the same reasons that @scolladon mentioned.

Sync test working (after your fix), but 'View Code Coverage' - not. 'No code coverage cache, please execute Run Sync Test on related test class before view code coverage'

Since I pushed this fix it seems that the lines not covered are no longer being returned in the code coverage as part of the RunTestsSynchronous response. The locationsNotCovered array now contains empty entries. This is possibly a SF bug, but it may be intentional in favor of another method. Either way, the response no longer returns what HaoIDE is expecting.

After inspecting with Fiddler, I can see that this is happening in the Developer Console (DC) too. However, when viewing code coverage in the DC, a separate query for coverage is made which does return the lines covered and uncovered. Unfortunately, the response from that call is very different from what is currently handled.

If this isn't a SF bug, two updates will need to be made. One in the processor.handle_run_sync_test function to retrieve the coverage using a query, as in the DC. The other would be in the util.view_coverage function to correctly read the new JSON structure of said query.

I'll submit a SF bug report tomorrow and see what they say. However, I don't expect a speedy response. Likely they'll instruct me to use the code coverage query method.

I'll keep you posted.