Skip to content

Commit 1f322d9

Browse files
authored
Test SFDX release candidate every week (#3558)
This PR extracts the SFDX integration tests into a reusable workflow so that we can test against the SFDX CLI's release candidates. It is intended to provide early warning of breaking changes. Edited to add: - integration test fixes for v4 that were missed in #3844 - `docutils`, which is required by `rst2ansi`
1 parent 5ae0e51 commit 1f322d9

7 files changed

Lines changed: 141 additions & 99 deletions

File tree

.github/workflows/chores.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,29 @@ jobs:
1212
hub_version: ${{ steps.devhub-api-version.outputs.hub_version }}
1313
cci_version: ${{ steps.cci-api-version.outputs.cci_version }}
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
ref: main
18-
- name: Set up Python
19-
uses: actions/setup-python@v4
2018
- name: Get Dev Hub API Version
2119
id: devhub-api-version
2220
env:
2321
HUB_URL: ${{ format('{0}/services/data', secrets.SFDO_HUB_URL) }}
2422
run: |
2523
version=$(curl -s $HUB_URL | jq -r '.[-1] | .version')
26-
echo "::set-output name=hub_version::$version"
24+
echo "hub_version=$version" >> $GITHUB_OUTPUT
2725
- name: Get CURRENT_SF_API_VERSION
2826
id: cci-api-version
2927
run: |
3028
version=$(yq '.project.package.api_version' cumulusci/cumulusci.yml)
31-
echo "::set-output name=cci_version::$version"
29+
echo "cci_version=$version" >> $GITHUB_OUTPUT
3230
update_api_versions:
3331
runs-on: SFDO-Tooling-Ubuntu
3432
needs: check_api_versions
3533
if: ${{ needs.check_api_versions.outputs.hub_version != needs.check_api_versions.outputs.cci_version }}
3634
env:
3735
VERSION: ${{ needs.check_api_versions.outputs.hub_version }}
3836
steps:
39-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
4038
with:
4139
fetch-depth: 0
4240
ref: main
@@ -58,3 +56,15 @@ jobs:
5856
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5957
run: |
6058
gh pr create --fill --label 'auto-pr'
59+
test_sfdx_release_candidate:
60+
uses: ./.github/workflows/release_test_sfdx.yml
61+
with:
62+
sfdx-release-channel: stable-rc
63+
secrets:
64+
CUMULUSCI_ORG_packaging: ${{ secrets.CUMULUSCI_ORG_packaging }}
65+
CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }}
66+
CCITEST_APP_KEY: ${{ secrets.CCITEST_APP_KEY }}
67+
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
68+
SFDX_HUB_KEY: ${{ secrets.SFDX_HUB_KEY }}
69+
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
70+
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}

.github/workflows/release_test.yml

Lines changed: 12 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,9 @@
11
name: Release Test
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
types: [opened, synchronize, reopened] # Default
6-
workflow_call:
7-
secrets:
8-
CUMULUSCI_ORG_packaging:
9-
required: true
10-
CUMULUSCI_SERVICE_github:
11-
required: true
12-
CCITEST_APP_KEY:
13-
required: true
14-
SFDX_CLIENT_ID:
15-
required: true
16-
SFDX_HUB_KEY:
17-
required: true
18-
SFDX_HUB_KEY_BASE64:
19-
required: true
20-
SFDX_HUB_USERNAME:
21-
required: true
22-
23-
env:
24-
CUMULUSCI_ORG_scratch: '{"config_file": "orgs/dev.json", "scratch": true}'
25-
CUMULUSCI_ORG_packaging: ${{ secrets.CUMULUSCI_ORG_packaging }}
26-
CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }}
27-
GITHUB_APP_ID: 129383
28-
GITHUB_APP_KEY: ${{ secrets.CCITEST_APP_KEY }}
29-
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
30-
SFDX_HUB_KEY: ${{ secrets.SFDX_HUB_KEY }}
31-
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
32-
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}
337

348
jobs:
359
test_artifacts:
@@ -67,50 +41,14 @@ jobs:
6741

6842
test_release:
6943
name: "Test Release Flows"
70-
runs-on: SFDO-Tooling-Ubuntu
71-
concurrency: release
72-
steps:
73-
- uses: actions/checkout@v3
74-
- name: Set up Python 3.11
75-
uses: actions/setup-python@v4
76-
with:
77-
python-version: 3.11
78-
cache: pip
79-
cache-dependency-path: "pyproject.toml"
80-
- name: Set up uv
81-
uses: SFDO-Tooling/setup-uv@main
82-
with:
83-
version: "0.5.0"
84-
enable-cache: true
85-
- name: Install Python dependencies
86-
run: uv sync
87-
- name: Install sfdx
88-
run: |
89-
mkdir sfdx
90-
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz | tar xJ -C sfdx --strip-components 1
91-
echo $(realpath sfdx/bin) >> $GITHUB_PATH
92-
- name: Authenticate Dev Hub
93-
run: |
94-
sfdx plugins --core
95-
echo $SFDX_HUB_KEY_BASE64 | base64 --decode > sfdx.key
96-
sfdx auth:jwt:grant --clientid $SFDX_CLIENT_ID --jwtkeyfile sfdx.key --username $SFDX_HUB_USERNAME --setdefaultdevhubusername -a hub
97-
- name: Check out CumulusCI-Test
98-
run: |
99-
git clone https://github.com/SFDO-Tooling/CumulusCI-Test
100-
- name: Run ci_feature flow
101-
run: |
102-
cd CumulusCI-Test
103-
uv run cci flow run ci_feature --org scratch --delete-org
104-
- name: Run ci_beta flow
105-
run: |
106-
cd CumulusCI-Test
107-
uv run cci flow run ci_beta --org scratch --delete-org
108-
- name: Run ci_master flow
109-
run: |
110-
cd CumulusCI-Test
111-
uv run cci flow run ci_master --org scratch --delete-org
112-
- name: Run release_beta flow
113-
run: |
114-
export SFDX_HUB_KEY="$(echo $SFDX_HUB_KEY_BASE64 | base64 --decode)"
115-
cd CumulusCI-Test
116-
uv run cci flow run release_beta --org packaging
44+
uses: ./.github/workflows/release_test_sfdx.yml
45+
with:
46+
sfdx-release-channel: stable
47+
secrets:
48+
CUMULUSCI_ORG_packaging: ${{ secrets.CUMULUSCI_ORG_packaging }}
49+
CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }}
50+
CCITEST_APP_KEY: ${{ secrets.CCITEST_APP_KEY }}
51+
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
52+
SFDX_HUB_KEY: ${{ secrets.SFDX_HUB_KEY }}
53+
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
54+
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: SFDX Integration Test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
sfdx-release-channel:
7+
required: false
8+
type: string
9+
default: stable
10+
secrets:
11+
CUMULUSCI_ORG_packaging:
12+
required: true
13+
CUMULUSCI_SERVICE_github:
14+
required: true
15+
CCITEST_APP_KEY:
16+
required: true
17+
SFDX_CLIENT_ID:
18+
required: true
19+
SFDX_HUB_KEY:
20+
required: true
21+
SFDX_HUB_KEY_BASE64:
22+
required: true
23+
SFDX_HUB_USERNAME:
24+
required: true
25+
26+
env:
27+
CUMULUSCI_ORG_scratch: '{"config_file": "orgs/dev.json", "scratch": true}'
28+
CUMULUSCI_ORG_packaging: ${{ secrets.CUMULUSCI_ORG_packaging }}
29+
CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }}
30+
GITHUB_APP_ID: 129383
31+
GITHUB_APP_KEY: ${{ secrets.CCITEST_APP_KEY }}
32+
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
33+
SFDX_HUB_KEY: ${{ secrets.SFDX_HUB_KEY }}
34+
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
35+
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}
36+
37+
jobs:
38+
test_release:
39+
name: "Test SFDX CLI"
40+
runs-on: SFDO-Tooling-Ubuntu
41+
concurrency: release
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Set up Python 3.11
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: 3.11
48+
cache: pip
49+
cache-dependency-path: "pyproject.toml"
50+
- name: Set up uv
51+
uses: SFDO-Tooling/setup-uv@main
52+
with:
53+
version: "0.5.0"
54+
enable-cache: true
55+
- name: Install Python dependencies
56+
run: uv sync
57+
- name: Install Salesforce CLI
58+
env:
59+
CHANNEL: ${{ inputs.sfdx-release-channel }}
60+
run: |
61+
mkdir sfdx
62+
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sf/channels/$CHANNEL/sf-linux-x64.tar.xz | tar xJ -C sfdx --strip-components 1
63+
echo $(realpath sfdx/bin) >> $GITHUB_PATH
64+
- name: Authenticate Dev Hub
65+
run: |
66+
sf plugins --core
67+
echo $SFDX_HUB_KEY_BASE64 | base64 --decode > sfdx.key
68+
sf org login jwt --client-id $SFDX_CLIENT_ID --jwt-key-file sfdx.key --username $SFDX_HUB_USERNAME --set-default-dev-hub --alias hub
69+
- name: Check out CumulusCI-Test
70+
run: |
71+
git clone https://github.com/SFDO-Tooling/CumulusCI-Test
72+
- name: Run ci_feature flow
73+
run: |
74+
cd CumulusCI-Test
75+
uv run cci flow run ci_feature --org scratch --delete-org
76+
- name: Run ci_beta flow
77+
run: |
78+
cd CumulusCI-Test
79+
uv run cci flow run ci_beta --org scratch --delete-org
80+
- name: Run ci_master flow
81+
run: |
82+
cd CumulusCI-Test
83+
uv run cci flow run ci_master --org scratch --delete-org
84+
- name: Run release_beta flow
85+
run: |
86+
export SFDX_HUB_KEY="$(echo $SFDX_HUB_KEY_BASE64 | base64 --decode)"
87+
cd CumulusCI-Test
88+
uv run cci flow run release_beta --org packaging

.github/workflows/slow_integration_tests.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,23 @@ jobs:
3131
python-version: 3.11
3232
cache: pip
3333
cache-dependency-path: "pyproject.toml"
34-
- name: Install Python dependencies
35-
run: |
36-
python -m pip install -U pip
37-
pip install .[test]
38-
- name: Install sfdx
34+
- name: Set up uv
35+
uses: SFDO-Tooling/setup-uv@main
36+
with:
37+
version: "0.5.0"
38+
enable-cache: true
39+
- name: Install dependencies
40+
run: uv sync -p 3.11
41+
- name: Install Salesforce CLI
3942
run: |
4043
mkdir sfdx
41-
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz | tar xJ -C sfdx --strip-components 1
44+
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-linux-x64.tar.xz | tar xJ -C sfdx --strip-components 1
4245
echo $(realpath sfdx/bin) >> $GITHUB_PATH
4346
- name: Authenticate Dev Hub
4447
run: |
45-
sfdx plugins --core
48+
sf plugins --core
4649
echo $SFDX_HUB_KEY_BASE64 | base64 --decode > sfdx.key
47-
sfdx auth:jwt:grant --clientid $SFDX_CLIENT_ID --jwtkeyfile sfdx.key --username $SFDX_HUB_USERNAME --setdefaultdevhubusername -a hub
50+
sf org login jwt --client-id $SFDX_CLIENT_ID --jwt-key-file sfdx.key --username $SFDX_HUB_USERNAME --set-default-dev-hub --alias hub
4851
env:
4952
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
5053
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
@@ -54,7 +57,7 @@ jobs:
5457
- name: Delete scratch org
5558
if: always()
5659
run: |
57-
cci org scratch_delete pytest
60+
uv run cci org scratch_delete pytest
5861
robot_ui:
5962
name: "Robot: ${{ matrix.job-name }}"
6063
runs-on: SFDO-Tooling-Ubuntu
@@ -80,26 +83,26 @@ jobs:
8083
cache: pip
8184
cache-dependency-path: "pyproject.toml"
8285
- name: Install Python dependencies
83-
run: pip install .[test]
84-
- name: Install sfdx
86+
run: pip install .
87+
- name: Install Salesforce CLI
8588
run: |
8689
mkdir sfdx
87-
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sf-linux-x64.tar.xz | tar xJ -C sfdx --strip-components 1
90+
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-linux-x64.tar.xz | tar xJ -C sfdx --strip-components 1
8891
echo $(realpath sfdx/bin) >> $GITHUB_PATH
8992
- name: Initialize Browser/Playwright
9093
run: cci robot install_playwright
9194
- name: Authenticate Dev Hub
9295
run: |
93-
sfdx plugins --core
96+
sf plugins --core
9497
echo $SFDX_HUB_KEY_BASE64 | base64 --decode > sfdx.key
95-
sf org login jwt --client-id $SFDX_CLIENT_ID --jwt-key-file sfdx.key --username $SFDX_HUB_USERNAME --setdefaultdevhubusername -a hub
98+
sf org login jwt --client-id $SFDX_CLIENT_ID --jwt-key-file sfdx.key --username $SFDX_HUB_USERNAME --set-default-dev-hub --alias hub
9699
env:
97100
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
98101
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
99102
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}
100103
- name: Run robot tests
101104
run: |
102-
coverage run --append $(which cci) task run robot \
105+
cci task run robot \
103106
--org ${{ matrix.org-shape }} \
104107
-o suites cumulusci/robotframework/tests/salesforce \
105108
-o exclude no-browser \

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ coverage: ## check code coverage quickly with the default Python
6464
$(BROWSER) htmlcov/index.html
6565

6666
vcr: # remake VCR cassettes and run other integration tests
67-
cci org scratch qa pytest
68-
cci org scratch_delete pytest
67+
uv run cci org scratch qa pytest
68+
uv run cci org scratch_delete pytest
6969
find . -name \Test*.yaml | xargs rm
70-
pytest --org qa --run-slow-tests -rs --replace-vcrs
70+
uv run pytest --org qa --run-slow-tests -rs --replace-vcrs
7171

7272
slow_tests: vcr # remake VCR cassettes and run other integration tests
73-
cci org scratch_delete pytest
73+
uv run cci org scratch_delete pytest
7474
pytest integration_tests/ --org pytest -rs
7575

7676
docs: ## generate Sphinx HTML documentation

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ dependencies = [
5454
"simple-salesforce==1.11.4",
5555
"snowfakery>=4.0.0",
5656
"xmltodict",
57+
"docutils>=0.21.2",
5758
]
5859

5960
[dependency-groups]

uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)