forcedotcom / LightningTestingService

Apache License 2.0
122 stars 35 forks source link

Unable to use LTS with SFDX #15

Closed keirbowden closed 7 years ago

keirbowden commented 7 years ago

I'm following the instructions to connect LTS to SalesforceDX. Once I've updated the plugin to work with the beta (via sfdx plugins:install salesforcedx@pre-release) I get the following error when trying to create a scratch org:

ERROR running force:org:create: You do not have access to the [ScratchOrgInfo] object.

(I'm guessing this might be because scratch orgs get created on CS70 at present which is a Spring 17 org)

If I revert back to the latest stable plugin then I can create the scratch orgs, albeit at version 39.0, so I've been trying to get as far as I can switching between the stable and pre-release plugins.

If I try to push the source using the pre-release, I get the error "the requested resource does not exist". I can push the source using the stable version if I make a few changes to lower the API version in the Apex meta-xml and remove references to recordData. Once this is done I can execute the Tests.app, but if I switch back to the pre-release plugin to use the force:lightning:test:run, I get the following error:

ERROR running force:lightning:test:run: An error occurred when running Lightning tests. The requested resource does not exist.

Should the pre-release plugin be able to create scratch orgs at API 40.0? Feels like that might solve the problem.

esalman-sfdc commented 7 years ago

@keirbowden thanks for reaching out.

Our CI job is able to create a scratch org, push the metadata, and run the sample tests successfully, https://travis-ci.org/forcedotcom/LightningTestingService

Lets figure out differences between the environments,

If you have the correct binary and plugin, I think at very least you should be able to force push the metadata to a prerelease org directly via "[Alternative] Push Metadata to a Developer Edition (DE) Org" section at https://github.com/forcedotcom/LightningTestingService/blob/master/developer-workflow.md while you try things out.

By the way, we know that you are fairly well versed in the topic of using Jasmine to test Lightning Components (among other things), and are looking forward for your feedback/contributions :)

esalman-sfdc commented 7 years ago

@wadewegner just a heads up, we may need your help with diagnosing the root cause of the error and possibly validating dev-hub setup.

keirbowden commented 7 years ago

@esalman-sfdc here's the steps that I've tried - I've gone through them again this morning and included any details:

  1. Uninstalled SFDX according to https://gist.github.com/dcarroll/7d7a4b97a0d77f26c9f6fc6d73b689a6
  2. Installed the latest sfdx via the installer, output of sfdx version: sfdx-cli/5.7.4-57b4969 (darwin-amd64) go1.7.3 sfdxstable
  3. Installed the latest pre-release plugin: sfdx plugins:install salesforcedx@pre-release
  4. Confirmed plugin version : sfdx plugins salesforcedx 40.0.7
  5. Cloned the lightning testing service repo: git clone https://github.com/forcedotcom/LightningTestingService.git
  6. Logged in to my SFDX pilot dev hub: sfdx force:auth:web:login --setdefaultdevhubusername --setalias my-hub-org
  7. Confirmed that the dev hub org is on Summer 17 - instance is eu11 and the org id is 00D0Y000001K5nT
  8. Attempted to create a scratch org using the command : sfdx force:org:create --definitionfile config/project-scratch-def.json --setalias LTS --setdefaultusername ERROR running force:org:create: You do not have access to the [ScratchOrgInfo] object.

If I revert back to version 39 of the SFDX plugin I can create scratch orgs fine.

Let me know if you need any further information.

esalman-sfdc commented 7 years ago

Version of cli and the plugin look correct. I believe hub org setup/shape requirements are changing between sfdx pilot and sfdx beta (currently on pre-release channel) which is contributing to the the error.

@ftahir @wadewegner what do you recommend? Can we update Keir's hub org's permissions a bit early so that he can proceed with LTS pilot.

keirbowden commented 7 years ago

Ah - okay, I guess that's one difference - your dev hub is gs0 and mine is eu11. I'll carry on with the package in a pre-release org for now.

esalman-sfdc commented 7 years ago

Hey @keirbowden want to resolve this for you but have a couple of questions.

would you prefer if your hub org 00D0Y000001K5nT gets re-configured to work with new version of the plugin or are you ok with having a new dev-hub org for LTS pilot? I would rather get your existing org re-configured but don't want to cause any unexpected disruption for you (incase you use that org for anything business critical).

keirbowden commented 7 years ago

@esalman-sfdc Existing org re-configured works fine for me - there are a few other people at BrightGen using it, but it's all experimental at the moment so nothing we can't live without.

Thanks!

esalman-sfdc commented 7 years ago

Hi Keir, Rohit Mehta from out Product Management team has offered to help with this. @rrmehta2 could you please get Keir access to a devHub org which works with beta (pre-release) version of sfdx plugin.

keirbowden commented 7 years ago

Sweet!

esalman-sfdc commented 7 years ago

SFDX beta announcement takes care of this :)

sisodiabhumca commented 7 years ago

I am also getting same error -

sfdx force:org:list === Orgs ALIAS USERNAME ORG ID CONNECTED STATUS ─── ────── ─────────────────────── ────────────────── ──────────────── (D) Devhub xxxxxxx 00D36000000umZuEAI Connected

esalman-sfdc commented 7 years ago

This particular issue was resolved. May be try double checking version of sfdx-plugin ('sfdx plugins' AND 'npm view salesforcedx') and the release version of the instance your dev-hub org is at (Summer'17 or Wintner'18) match up.