Skip to content

Commit

Permalink
Merge pull request #241 from cumulus-nasa/release-test-pr
Browse files Browse the repository at this point in the history
add AWS Integration tests to the core repo
  • Loading branch information
Alireza committed Mar 13, 2018
2 parents 1c5ce4c + 5d13e8b commit 7d88e3a
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 11 deletions.
37 changes: 36 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ jobs:
paths:
- ./cumulus/services/sfn-scheduler/node_modules
- ./cumulus/services/sfn-throttler/node_modules


- run:
name: Running Tests
Expand All @@ -133,7 +134,40 @@ jobs:
environment:
LOCALSTACK_HOST: localstack
command: yarn e2e


- run:
name: Running AWS Integration Tests
command: |
if [[ "$CIRCLE_BRANCH" =~ release-.* ]]; then
sudo chown -R circleci:circleci /usr/local/bin
# install cumulus-integration
branch="${INTEGRATION_TEST_BRANCH:-master}"
git clone -b ${branch} https://github.com/cumulus-nasa/cumulus-integration-tests.git ~/integration
cd ~/integration
yarn
# extract list of cumulus packages used in the integration test
cat package.json | jq '.dependencies | to_entries[] | select(.key | startswith("@cumulus")).key' > cumulus_integration_tests_packages.txt
cd ~/project
# run the build command on the packages used on the integration tests
cat ../integration/cumulus_integration_tests_packages.txt | xargs -I % ./node_modules/.bin/lerna exec --scope % -- yarn build
# run the yarn link on packages used on the integration tests
cat ../integration/cumulus_integration_tests_packages.txt | xargs -I % ./node_modules/.bin/lerna exec --scope % -- yarn link
cd ~/integration
# run the yarn link package-name on the integration tests
cat cumulus_integration_tests_packages.txt | xargs -I % yarn link %
# deploy latest version of the packages to the aws
yarn deploy
# run the tests
yarn test
fi
build_and_publish:
docker:
- image: circleci/node:6.10
Expand All @@ -157,6 +191,7 @@ jobs:
VERSION=$(cat lerna.json | jq .version --raw-output)
./node_modules/.bin/lerna publish --skip-git --repo-version $VERSION --yes --force-publish=*
workflows:
version: 2
build_test_deploy:
Expand Down
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@ Things that should succeed before merging.

- [ ] Unit tests
- [ ] Adhoc testing
- [ ] Update CHANGELOG

## Release PR

If this is a **release** PR, make sure you branch name starts with `release-` prefix, e.g. `release-v-1.1.2`.

Reviewers: @tag-your-friends
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Broke up `kes.override.js` of @cumulus/deployment to multiple modules and moved to a new location
- Expanded @cumulus/deployment test coverage
- all tasks were updated to use cumulus-message-adapter-js 1.0.1
- added build process to integration-tests package to babelify it before publication

## [v1.1.1] - 2018-03-08

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ Lerna will update the version of all packages after the selection. You then have

The version number updates should be put in a PR and committed to master along with the changelog updates. After merging to master, tag the master branch with a release using the new version number.

#### Release PR

Release PRs **MUST** be named with `release-` prefix. This will kick off the AWS integration tests in the CI process and ensures that package updates are fully tested on AWS before publication to NPM.

### Publishing to NPM

All packages on master branch are automatically published to NPM.
Expand Down
14 changes: 6 additions & 8 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
},
"babel": {
"presets": [
"es2015"
],
"plugins": [
"transform-async-to-generator"
["env", {
"targets": {
"node": "6.10"
}
}]
]
},
"author": "Cumulus Authors",
Expand All @@ -47,11 +48,8 @@
"aws-sdk": "^2.4.11",
"babel-core": "^6.13.2",
"babel-eslint": "^6.1.2",
"babel-loader": "^6.2.4",
"babel-plugin-transform-async-to-generator": "^6.8.0",
"babel-polyfill": "^6.13.0",
"babel-preset-env": "^1.4.0",
"babel-preset-es2015": "^6.13.2",
"babel-preset-env": "^1.6.1",
"cwait": "^1.0.0",
"eslint": "^3.2.2",
"eslint-config-airbnb": "^10.0.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"bin": {
"cumulus-test": "./bin/cli.js"
},
"main": "dist/index.js",
"repository": {
"type": "git",
"url": "https://github.com/cumulus-nasa/cumulus"
},
"scripts": {
"build": "webpack --progress",
"watch": "webpack --progress -w"
"watch": "webpack --progress -w",
"postinstall": "npm run build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
entry: ['babel-polyfill', './index.js'],
entry: ['./index.js'],
output: {
libraryTarget: 'commonjs2',
filename: 'dist/index.js'
Expand Down

0 comments on commit 7d88e3a

Please sign in to comment.