Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into bugfix/use_lower_uid_in_dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
rody authored Aug 8, 2023
2 parents 1d0d8e9 + 185b6fb commit 9255bfb
Show file tree
Hide file tree
Showing 155 changed files with 18,006 additions and 143,005 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/buildPackages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2
with:
version: 8

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: https://registry.npmjs.org/
Expand All @@ -41,7 +45,7 @@ jobs:
- name: 'Install Dependencies'
run: npm i
run: pnpm i


- name: 'Build All Packages'
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- uses: pnpm/action-setup@v2
with:
version: 8

- name: 'Install Dependencies'
run: pnpm i
- run: npx lerna run build
- run: npx lerna run test -- --colors
- run: bash <(curl -s https://codecov.io/bash) -v
Expand Down
6 changes: 3 additions & 3 deletions decision records/validate/001-automated-apex-testing-retry.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ During validate stage, sfpowerscripts triggers apex testing for each package and
- For Source Package, each individual apex class have more than 75% of coverage or more
- For Unlocked Packages, each package has an overall coverage of more than 75% of coverage or more

These tests are by default triggered asynchronously (in parallel), with a request to calculate coverage as well. Most projects however find it really difficult to get all the test of package to execute synchronously. After confirming with Salesforce Product team, tests are always triggered synchronously during Package Validation (build) or during deployment (source packages). Executing tests synchronously is extremely consuming on packages with larger number of test classes.
These tests are by default triggered asynchronously (in parallel), with a request to calculate coverage as well. Most projects however find it really difficult to get all the test of package to execute synchronously. After confirming with Salesforce Product team, tests are always triggered synchronously during Package Validation (build) or during deployment (source packages). Executing tests synchronously is extremely time consuming on packages with larger number of test classes.

There are also situations where bulk of the apex test in a package can be executed asynchronously with a few test cases that need to be triggered in synchronous mode.

A recently surfaced issue (#836), have uncovered coverage calculation becoming erratic randomly. This is attributed to the fact that asynchronous tests may trigger parallel compilation of classes under test and code coverage calculation is skipped.

## Decision

sfpowerscripts will collect all the test classes that failed in an asynchronous run due to 'UNABLE_TO_LOCK_ROW' or 'Your request exceeded the time limit for processing' and trigger these tests in synchronous mode.
sfpowerscripts will collect all the test classes that failed in an asynchronous run due to 'UNABLE_TO_LOCK_ROW', 'Your request exceeded the time limit for processing' or an 'Internal Salesforce Error' and trigger these tests in synchronous mode.

sfpowerscripts will also figure out any tests classes that were not able to contribute to code coverage and execute them synchronously. As the current test api has limitation on how tests could be triggered synchronously (only one test class is allowed), sfpowerscripts will change the mode of the org to 'Disable Parallel Testing' by changing the apex setting as mentioned [ here](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_apexsettings.htm). sfpowerscripts will utilize jsforce update (http://jsforce.github.io/jsforce/doc/Metadata.html) to update this setting on the fly.
Once the setting is succesfully toggled, it will proceed to execute these tests using asynchronous payload, which is equivalent to triggering test classes synchronously. The coverage results are then converged and new coverage value is calculated
Once the setting is successfully toggled, it will proceed to execute these tests using asynchronous payload, which is equivalent to triggering test classes synchronously. The coverage results are then converged and new coverage value is calculated

The retry is only attempted once and provided there is no other failures in the first run other than the issues mentioned above
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"packages": ["packages/*"],
"npmClient":"pnpm",
"version": "independent",
"command": {
"publish": {
Expand Down
Loading

0 comments on commit 9255bfb

Please sign in to comment.