-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cd: Add smoke tests for CJS and ES modules (#395)
Co-authored-by: Quinn Hanam <qhanam@gmail.com> --------- Co-authored-by: Quinn Hanam <qhanam@gmail.com>
- Loading branch information
Showing
25 changed files
with
1,541 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
PRE_OR_POST_RELEASE=$1 | ||
MODULE_TYPE=$2 | ||
|
||
|
||
if [ "$PRE_OR_POST_RELEASE" = "PRE" ]; then | ||
if [ "$MODULE_TYPE" = "NPM-ES" ]; then | ||
cd smoke/smoke-test-application-NPM-ES | ||
npm uninstall aws-rum-web | ||
npm run clean | ||
npm install | ||
npm install /home/runner/work/aws-rum-web/aws-rum-web #Install locally | ||
npm run build | ||
elif [ "$MODULE_TYPE" = "NPM-CJS" ]; then | ||
cd smoke/smoke-test-application-NPM-CJS | ||
npm uninstall aws-rum-web | ||
npm run clean | ||
npm install | ||
npm install $(npm pack /home/runner/work/aws-rum-web/aws-rum-web | tail -1) #Install locally | ||
npm run build | ||
else | ||
echo "Not a valid module type" | ||
fi | ||
elif [ "$PRE_OR_POST_RELEASE" = "POST" ]; then | ||
|
||
if [ "$MODULE_TYPE" = "NPM-ES" ]; then | ||
cd smoke/smoke-test-application-NPM-ES | ||
npm uninstall aws-rum-web | ||
npm run clean | ||
npm install | ||
npm install aws-rum-web #Install latest released direct from NPM | ||
npm run build | ||
elif [ "$MODULE_TYPE" = "NPM-CJS" ]; then | ||
cd smoke/smoke-test-application-NPM-CJS | ||
npm uninstall aws-rum-web | ||
npm run clean | ||
npm install | ||
npm install aws-rum-web #Install latest released direct from NPM | ||
npm run build | ||
else | ||
echo "Not a valid module type" | ||
fi | ||
else | ||
echo "No valid option. Please provide PRE OR POST" | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
bucket=$1 | ||
key=smoke-$(npm pkg get version | sed 's/"//g').html | ||
aws s3api put-object --bucket $bucket --key "$key" --body processed_smoke.html --content-type "text/html" | ||
version=$(npm pkg get version | sed 's/"//g') | ||
|
||
# CDN | ||
aws s3api put-object --bucket $bucket --key "smoke-$version.html" --body processed_smoke.html --content-type "text/html" | ||
|
||
# NPM ES | ||
aws s3api put-object --bucket $bucket --key "npm/es/$version/smoke.html" --body smoke/smoke-test-application-NPM-ES/app/smoke.html --content-type "text/html" | ||
aws s3api put-object --bucket $bucket --key "npm/es/$version/loader_npm_rum_tmp.js" --body smoke/smoke-test-application-NPM-ES/build/dev/loader_npm_rum_tmp.js --content-type application/x-javascript | ||
|
||
# NPM CJS | ||
aws s3api put-object --bucket $bucket --key "npm/cjs/$version/smoke.html" --body smoke/smoke-test-application-NPM-CJS/app/smoke.html --content-type "text/html" | ||
aws s3api put-object --bucket $bucket --key "npm/cjs/$version/loader_npm_rum_tmp.js" --body smoke/smoke-test-application-NPM-CJS/build/dev/loader_npm_rum_tmp.js --content-type application/x-javascript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ coverage | |
src/events | ||
package-lock.json | ||
docs/ | ||
.vscode | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.