0

enter image description hereenter image description hereI am trying to run a robot test on CircleCI using the command cci task run robot, but it is creating the fresh org again as it executes.

I am using below commands,

venv/bin/cci flow run qa_org --org dev venv/bin/cci task run robot --org dev -o suites robot/tests/Activities.robot -o include test -o vars LocalOrRemote:Local,Browser:googlechrome

CircleCI Yml

 version: 2  orbs:   
win: circleci/windows@1.0.0 jobs: # A basic unit of work in a run   
build: # runs not using Workflows must have a `build` job as entry point 
        # directory where steps are run
        working_directory: ~/repo
        docker: # run the steps with Docker
          # CircleCI Python images available at: https://hub.docker.com/r/circleci/python/
          - image: circleci/python:3.7.2
            environment: # environment variables for primary container
              CUMULUSCI_KEYCHAIN_CLASS: cumulusci.core.keychain.EnvironmentProjectKeychain   steps: # steps that comprise the `build` job
          - checkout 
     - run:
                 name: Install Python deps in a venv
                 command: |
                     virtualenv venv                 
                     venv/bin/pip install -r requirements_dev.txt
    - run:
              name: Download sfdx
              command: |
                mkdir sfdx
                sudo wget -qO- https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz | tar xJ -C sfdx --strip-components 1
          - run:
              name: Install sfdx
              command: |
                ./sfdx/install
                sfdx
                mkdir tmp   
     - run: 
                 name: Create Hub
                 command: |
                     openssl enc -nosalt -aes-256-cbc -d -in access/server.key.enc -out access/server.key -base64 -K $DECRYPTION_KEY -iv $DECRYPTION_IV
                     sfdx force:auth:jwt:grant -i $HUB_CONSUMER_KEY -f ./access/server.key -u $HUB_SFDX_USER --setdefaultdevhubusername -a hub
          - run:
                 name: Create Org
                 command: |
                     venv/bin/cci flow run qa_org --org dev    
                     venv/bin/cci task run robot --org dev -o suites robot/tests/Activities.robot -o include test -o vars LocalOrRemote:Local,Browser:googlechrome
  • 1
    Can you share the relevant sections from your CircleCI YML configuration? – David Reed Jan 3 at 14:47
  • I have added CircleCI YML file in the question – Pronit Agrawal Jan 3 at 17:51
  • Could you try setting dev as the default or after running qa_org flow? It should be: venv/bin/cci org default dev – Brand0R Jan 3 at 18:15
  • Also, can you share more information about how you know it's creating a fresh org? Do you have build logs that show CCI's output during the build? – David Reed Jan 3 at 18:19
  • setting as default did not worked, - run: name: Create Hub command: | openssl [...] sfdx force[...] venv/bin/cci flow run qa_org --org dev venv/bin/cci org default dev - run: name:Run Robot Test command: | venv/bin/cci task run robot --org dev -o suites [...] – Pronit Agrawal Jan 3 at 18:42
1

I don't have a complete explanation for this issue, but I think the information you've supplied gives a pretty good shot at pinning down where it is located.

CumulusCI appears to me to be working correctly, and you're running the correct commands.

The issue appears to me to lie in your CircleCI YML. The YML you've shared here does not match the screenshot, so it's hard to give a firm diagnosis. The screenshot, however, clearly shows your cci flow run qa_org command being run twice, once in the Create Hub step and once in the Create Org step. That's not your intent, and it's not correct.

A possible cause is that your YML file is indented incorrectly. You should ensure that your - run: steps all have the same indentation, as part of the same YML list. It is not immediately clear to me how this mistake will be interpreted by some YML parser and then subsequently by CircleCI, but it's a clear issue and might be the ultimate source of this confusing behavior.

However, the YML, again, does not match the screenshot, so it's hard to be 100% clear. I would fix the YML formatting first and see if that fixes the problem.

| improve this answer | |
  • I have update the screenshot as per my YML, I am getting the same issue, first command i.e"venv/bin/cci flow run qa_org --org dev" this is creating new org and than pushing the code. second one "venv/bin/cci task run robot --org dev -o suites robot/tests.robot -o include test -o vars LocalOrRemote:Local,Browser:googlechrome" is creating new org than running the test cases. – Pronit Agrawal Jan 7 at 3:05
  • Issue was with the "CUMULUSCI_KEYCHAIN_CLASS". check the link for more update salesforce.stackexchange.com/questions/290323/… – Pronit Agrawal Jan 8 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.