diff --git a/.circleci/config.yml b/.circleci/config.yml index 97bc5f8d4da..0ee1b978506 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -121,6 +121,7 @@ jobs: paths: - ./cumulus/services/sfn-scheduler/node_modules - ./cumulus/services/sfn-throttler/node_modules + - run: name: Running Tests @@ -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 @@ -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: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9391d52aff5..d3f21a3919a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e4ea54c130..92d6d84ccf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 8d5afe9d4f7..86e862f33fc 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/packages/common/package.json b/packages/common/package.json index e1f2ef81f9b..7ac86f11373 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -31,10 +31,11 @@ }, "babel": { "presets": [ - "es2015" - ], - "plugins": [ - "transform-async-to-generator" + ["env", { + "targets": { + "node": "6.10" + } + }] ] }, "author": "Cumulus Authors", @@ -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", diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index b262f965396..d48ea703f1d 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -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" diff --git a/packages/integration-tests/webpack.config.js b/packages/integration-tests/webpack.config.js index 3d163ff19ed..3ed7304a281 100644 --- a/packages/integration-tests/webpack.config.js +++ b/packages/integration-tests/webpack.config.js @@ -1,5 +1,5 @@ module.exports = { - entry: ['babel-polyfill', './index.js'], + entry: ['./index.js'], output: { libraryTarget: 'commonjs2', filename: 'dist/index.js'