Skip to content

Commit

Permalink
Merge branch 'develop' into feature/GH-3075
Browse files Browse the repository at this point in the history
  • Loading branch information
dydome committed Jan 29, 2021
2 parents 3476bf0 + 36ea1d5 commit b3a0d14
Show file tree
Hide file tree
Showing 745 changed files with 36,046 additions and 2,017 deletions.
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/new-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ assignees: ''

Once finished, run `./run.sh start` to start the apps and check that they are working. You can also go to each app directory and run it with `yarn build`, `start`, `build:ssr`, etc.

- [ ] Run all e2e tests on this latest build (Pro tip: run mobile, regression, smoke scripts in parallel to get all the results faster, after that retry failed tests in open mode)
- [ ] Run all e2e tests on this latest build (Pro tip: run mobile, regression scripts in parallel to get all the results faster, after that retry failed tests in open mode)

---

Expand Down Expand Up @@ -82,6 +82,8 @@ To keep track of spartacussampledata releases, we keep a `latest` branch on each
- [ ] `npm run release:setup:with-changelog` (needed since `3.0.0-next.1`)
- [ ] `npm run release:organization:with-changelog` (needed since `3.0.0-next.1`)
- [ ] `npm run release:storefinder:with-changelog` (needed since `3.0.0-rc.0`)
- [ ] `npm run release:qualtrics:with-changelog` (needed since `3.1.0-next.0`)
- [ ] `npm run release:product-configurator:with-changelog` (needed since `3.1.0-next.0`)
- [ ] `npm run release:cdc:with-changelog` (since 2.1.0-next.0 - publish under `0.<packages-version>.0` eg. `0.201.0-next.0` for first `2.1.0-next.0` release)
- [ ] before the script set the spartacus peerDependencies manually (as we publish it under 0.201.0-next.0 version)
- [ ] Check that the release notes are populated on github (if they are not, update them)
Expand Down
16 changes: 14 additions & 2 deletions .github/api-extractor-action/src/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function extractListOfNotAnalyzedEntryPoints(
.filter((entryPoint) => {
return (
entryPoint.head.status === Status.Failed &&
entryPoint.base.status === Status.Failed
entryPoint.base.status !== Status.Success
);
})
.map((entryPoints) => {
Expand Down Expand Up @@ -217,12 +217,24 @@ New error: \`${entry.head.errors[0]}\``;
}
} else if (entry.head.status === Status.Unknown) {
return `### :boom: ${entry.name}\nEntry point removed. Are you sure it was intentional?`;
} else if (entry.base.status === Status.Unknown) {
} else if (
entry.base.status === Status.Unknown &&
entry.head.status === Status.Success
) {
const publicApi = extractSnippetFromFile(`${REPORT_DIR}/${entry.file}`);
return `### :warning: ${entry.name}
New entry point. Initial public api:
\`\`\`ts
${publicApi}
\`\`\``;
} else if (
entry.base.status === Status.Unknown &&
entry.head.status === Status.Failed
) {
return `### :boom: ${entry.name}
New entry point that can't be analyzed with api-extractor. Please check the errors:
\`\`\`
${entry.head.errors.join('\n')}
\`\`\``;
}
return '';
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/config-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
pull_request:
types: [opened, synchronize, reopened]
name: Config check
jobs:
configCheck:
name: Dependencies and tsconfig files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v2
with:
node-version: '12'
- name: Yarn
run: yarn
- name: Check configurations
run: yarn config:check
env:
FORCE_COLOR: 2 # Support colors from chalk
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ branches:
- "/^epic\\/.*$/"
- "/^release\\/.*$/"
defaults: &defaults
script: "./ci-scripts/e2e-cypress.sh -s regression"
script: "./ci-scripts/e2e-cypress.sh"
jobs:
- script: "./build.sh sonar"
- script: "./ci-scripts/e2e-cypress.sh -s b2b"
- script:
name: "Cypress regression tests, 1st job"
env: STAGE_NAME=spa-ci-regression
Expand Down
84 changes: 84 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,17 @@
"input": "projects/storefrontapp/src/styles/lib-organization.scss",
"bundleName": "organization"
},
{
"input": "projects/storefrontapp/src/styles/lib-product-configurator.scss",
"bundleName": "product-configurator"
},
{
"input": "projects/storefrontapp/src/styles/lib-storefinder.scss",
"bundleName": "storefinder"
},
{
"input": "projects/storefrontapp/src/styles/lib-qualtrics.scss",
"bundleName": "qualtrics"
}
],
"stylePreprocessorOptions": {
Expand Down Expand Up @@ -487,6 +495,44 @@
}
}
},
"product-configurator": {
"projectType": "library",
"root": "feature-libs/product-configurator",
"sourceRoot": "feature-libs/product-configurator",
"prefix": "cx",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "feature-libs/product-configurator/tsconfig.lib.json",
"project": "feature-libs/product-configurator/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "feature-libs/product-configurator/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "feature-libs/product-configurator/test.ts",
"tsConfig": "feature-libs/product-configurator/tsconfig.spec.json",
"karmaConfig": "feature-libs/product-configurator/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"feature-libs/product-configurator/tsconfig.lib.json",
"feature-libs/product-configurator/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
}
}
}
},
"cdc": {
"projectType": "library",
"root": "integration-libs/cdc",
Expand Down Expand Up @@ -600,6 +646,44 @@
}
}
}
},
"qualtrics": {
"projectType": "library",
"root": "feature-libs/qualtrics",
"sourceRoot": "feature-libs/qualtrics",
"prefix": "cx",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "feature-libs/qualtrics/tsconfig.lib.json",
"project": "feature-libs/qualtrics/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "feature-libs/qualtrics/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "feature-libs/qualtrics/test.ts",
"tsConfig": "feature-libs/qualtrics/tsconfig.spec.json",
"karmaConfig": "feature-libs/qualtrics/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"feature-libs/qualtrics/tsconfig.lib.json",
"feature-libs/qualtrics/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
}
}
}
}
},
"defaultProject": "storefrontapp"
Expand Down
39 changes: 15 additions & 24 deletions ci-scripts/e2e-cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ POSITIONAL=()
readonly help_display="Usage: $0 [ command_options ] [ param ]
command options:
--suite, -s choose an e2e suite to run. Default: regression
--integration, -i run the correct e2e integration suite. Default: "" for smoke tests
--environment, --env [1905 | 2005 | ccv2]. Default: 1905
--help, -h show this message and exit
--suite, -s choose an e2e suite to run. Default: b2c
--integration, -i run an additional e2e integration suite (cds, cdc, etc)
--environment, --env [ 2005 | 2011 | ccv2]. Default: 2005
--help, -h show help
"

while [ "${1:0:1}" == "-" ]
do
case "$1" in
'--suite' | '-s' )
SUITE=$2
SUITE=":$2"
shift
shift
;;
Expand Down Expand Up @@ -47,17 +47,17 @@ done

set -- "${POSITIONAL[@]}"


if [[ -z "${CI_ENV}" ]]; then
CI_ENV=":2005"
fi

yarn
(cd projects/storefrontapp-e2e-cypress && yarn)

echo '-----'
echo 'Building Spartacus libraries'
# Currently for our unified app you have to build all libraries to run it
echo "Building Spartacus libraries"

yarn install

(cd projects/storefrontapp-e2e-cypress && yarn install)

yarn build:libs && yarn build"${INTEGRATION}" 2>&1 | tee build.log

results=$(grep "Warning: Can't resolve all parameters for" build.log || true)
Expand All @@ -70,18 +70,9 @@ else
exit 1
fi

echo '-----'
echo "Running Cypress end to end tests"

# Hardcoded 2005 becuase cypress.ci.b2b.json currently supports only 2005.
# TODO: The condition should be removed and logic here simplified, when fixing https://github.com/SAP/spartacus/issues/10160
SHOULD_RUN_B2B=false;
yarn e2e:cy"${INTEGRATION}":start-run-ci"${CI_ENV}${SUITE}"

echo '-----'
echo "Running Cypress end to end tests for suite: $SUITE"
if [[ $SUITE == 'regression' ]]; then
yarn e2e:cy"${INTEGRATION}":start-run-ci"${CI_ENV}"
else
yarn e2e:cy"${INTEGRATION}":start-run-smoke-ci"${CI_ENV}"
if [[ $SHOULD_RUN_B2B ]]; then
yarn e2e:cy"${INTEGRATION}":start-run-smoke-ci"${CI_ENV}":b2b
fi
fi
echo "Running Cypress end to end tests finished"
32 changes: 30 additions & 2 deletions ci-scripts/unit-tests-sonar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [[ -n "$coverage" ]]; then
exit 1
fi

echo "Running unit tests and code coverage for Spartacus core"
echo "Running unit tests and code coverage for core"
exec 5>&1
output=$(ng test core --watch=false --sourceMap --code-coverage --browsers=ChromeHeadless | tee /dev/fd/5)
coverage=$(echo $output | grep -i "does not meet global threshold" || true)
Expand All @@ -22,7 +22,7 @@ if [[ -n "$coverage" ]]; then
exit 1
fi

echo "Running unit tests and code coverage for storefront library"
echo "Running unit tests and code coverage for storefrontlib"
exec 5>&1
output=$(ng test storefrontlib --sourceMap --watch=false --code-coverage --browsers=ChromeHeadless | tee /dev/fd/5)
coverage=$(echo $output | grep -i "does not meet global threshold" || true)
Expand All @@ -31,6 +31,22 @@ if [[ -n "$coverage" ]]; then
exit 1
fi

echo "Running unit tests and code coverage for product library"
exec 5>&1
output=$(ng test product --sourceMap --watch=false --code-coverage --browsers=ChromeHeadless | tee /dev/fd/5)

echo "Running unit tests and code coverage for product-configurator library"
exec 5>&1
output=$(ng test product-configurator --sourceMap --watch=false --code-coverage --browsers=ChromeHeadless | tee /dev/fd/5)
coverage=$(echo $output | grep -i "does not meet global threshold" || true)
if [[ -n "$coverage" ]]; then
echo "Error: Tests did not meet coverage expectations"
exit 1
fi
echo "Running schematics unit tests and code coverage for product-configurator library"
exec 5>&1
output=$(yarn --cwd feature-libs/product-configurator run test:schematics --coverage=true | tee /dev/fd/5)

echo "Running unit tests and code coverage for CDC"
exec 5>&1
output=$(ng test cdc --sourceMap --watch=false --code-coverage --browsers=ChromeHeadless | tee /dev/fd/5)
Expand Down Expand Up @@ -64,6 +80,18 @@ echo "Running schematics unit tests and code coverage for storefinder library"
exec 5>&1
output=$(yarn --cwd feature-libs/storefinder run test:schematics --coverage=true | tee /dev/fd/5)

echo "Running unit tests and code coverage for qualtrics library"
exec 5>&1
output=$(ng test qualtrics --sourceMap --watch=false --code-coverage --browsers=ChromeHeadless | tee /dev/fd/5)
coverage=$(echo $output | grep -i "does not meet global threshold" || true)
if [[ -n "$coverage" ]]; then
echo "Error: Tests did not meet coverage expectations"
exit 1
fi
echo "Running schematics unit tests and code coverage for qualtrics library"
exec 5>&1
output=$(yarn --cwd feature-libs/qualtrics run test:schematics --coverage=true | tee /dev/fd/5)

echo "Running unit tests and code coverage for setup"
exec 5>&1
output=$(ng test setup --sourceMap --watch=false --code-coverage --browsers=ChromeHeadless | tee /dev/fd/5)
Expand Down
12 changes: 1 addition & 11 deletions ci-scripts/validate-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
set -e
set -o pipefail

function validatestyles {
echo "-----"
echo "Validating styles app"
pushd projects/storefrontstyles
yarn
yarn sass
rm -rf temp-scss
popd
}

function validateStylesLint {
echo "----"
echo "Running styleslint"
Expand Down Expand Up @@ -60,7 +50,6 @@ else
exit 1
fi

validatestyles
validateStylesLint

echo "Validating code linting"
Expand All @@ -72,6 +61,7 @@ echo "Cleaning schematics js files before prettier runs..."
yarn --cwd projects/schematics run clean
yarn --cwd feature-libs/organization run clean:schematics
yarn --cwd feature-libs/storefinder run clean:schematics
yarn --cwd feature-libs/qualtrics run clean:schematics

echo "Validating code formatting (using prettier)"
yarn prettier 2>&1 | tee prettier.log
Expand Down
18 changes: 10 additions & 8 deletions core-libs/setup/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
{
"name": "@spartacus/setup",
"version": "3.0.0",
"version": "3.1.0-next.0",
"description": "Includes features that makes Spartacus and it's setup easier and streamlined.",
"homepage": "https://github.com/SAP/spartacus",
"keywords": [
"spartacus",
"framework",
"storefront",
"setup",
"recipe"
],
"homepage": "https://github.com/SAP/spartacus",
"repository": "https://github.com/SAP/spartacus/tree/develop/core-libs/setup",
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
"dependencies": {
"tslib": "^2.0.0"
},
"repository": "https://github.com/SAP/spartacus/tree/develop/core-libs/setup",
"peerDependencies": {
"@angular/common": "^10.1.0",
"@angular/core": "^10.1.0",
"rxjs": "^6.6.0",
"@spartacus/core": "3.0.0",
"@spartacus/storefront": "3.0.0"
"@spartacus/core": "3.1.0-next.0",
"@spartacus/storefront": "3.1.0-next.0"
},
"optionalDependencies": {
"@nguniversal/express-engine": "^10.1.0",
"express": "^4.15.0"
},
"publishConfig": {
"access": "public"
}
}
Loading

0 comments on commit b3a0d14

Please sign in to comment.