Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 2.78 KB

contributing.md

File metadata and controls

46 lines (28 loc) · 2.78 KB

Developing and contributing to Claudia

AWS Lambda currently supports Node.js 4.3.2 and 0.10.36. The support for 0.10 is going away in October 2016. Until then, please run all tests using both versions before submitting a pull request. You can use nvm to manage multiple versions of Node on your development environment.

One important downside of 0.10 support is lack of support for promises. Newer Node.js versions support promises out of the box, but Claudia has to use an external dependency for that. To support future migration to the standard API easier, please use the bluebird promise library. Once Node 0.10 is no longer supported in Lambda, we'll drop the external library and migrate to internal Promises.

Folder structure

The main body of code is in the src directory. Any JS files in the commands subdir are automatically loaded as options for the command-line utility. Commands can expect to get a key-value set of options entered from the command line, and need to return a promise for the execution result. If you add or modify a command, please also update the usage guide.

Sub-tasks directly related to automating and aggregating AWS workflows should go to the tasks directory, and generic reusable utility functions should go to the util directory.

Claudia has extensive unit and integration tests in the spec directory. Ideally, any new code should also be accompanied by a new test, so we can simplify future maintenance and development. Unless there is a very compelling reason to use something different, please continue using Jasmine for tests.

Running tests

Setting credentials for tests

See the Getting Started guide for information on how to set up the credentials to run tests. In addition to the ideas there, to allow you to separate out a testing profile from normal operation profiles, you can store additional environment variables or override existing environment values by creating a .env file in the project root. (This file is ignored by .gitignore, so you don't have to worry about uploading it by mistake.) If that file exists, it will be loaded into the environment at the start of a test run.

The easiest way to manage a separate testing profile is probably to define the actual keys in your main .aws/config file, and use just the AWS_PROFILE key in the .env file, like this:

AWS_PROFILE=claudia-test

Running tests

Run all the test, show a summary of the results:

npm test

Run the tests, and show individual test names

npm test -- full

Run only a selected set of tests, filtering by name:

npm test -- filter=prefix