Skip to content

Latest commit

 

History

History
96 lines (70 loc) · 3.48 KB

GettingStarted.md

File metadata and controls

96 lines (70 loc) · 3.48 KB

Working on the SDK

Things to Know

  • The SDK is built on Java 8
  • Maven is used as the build and dependency management system
  • The majority of the service client code is auto-generated using the code generator

Development Environment Setup Tips

If you use IntelliJ IDEA, the following config files will be used by default for your project-level settings:

  • Copyright

    This automatically inserts the license header to the top of source files that you create.

  • Code style

    This will help ensure your code follows our code style guidelines.

  • Inspections

    This will help ensure your code is correct and follows our best practices. Please ensure your changes do not generate any new inspection warnings.

If you have Checkstyle integrated with your IDE, we also recommend configuring it with our Checkstyle config so you can see any violations in line with the code.

Building

Since the SDK is a normal Maven project, the usual mvn package and mvn install commands are all you need to build the SDK.

One important thing to note is that if you're working on the code generator, be sure to do a mvn install rather than a phase that comes earlier such as compile or test so that the build uses the correct code generator JAR (i.e. the one including your changes). When in doubt, just use mvn package.

Disabling Checkstyle/FindBugs

Normally Checkstyle and FindBugs scans run as part of the build process. However, this slows down the build significantly so if you need to be able to iterate quickly locally, you can turn either of them off by setting the appropriate properties:

# skips both Checkstyle and FindBugs
$ mvn install -Dfindbugs.skip=true -Dcheckstyle.skip=true

Testing

Unit Tests

As described in the project structure, tests are split between unit and integration tests. During the normal test lifecycle phase, only the unit tests are run.

# runs the unit tests
mvn install

Integration Tests

Before running the integration tests, be aware that they require active AWS IAM credentials, and because they will make actual calls to AWS, will incur a cost to the owner of the account.

If you're writing an integration test, try to see if it's possible to write it as a set of unit tests with mocked responses instead.

Test Credentials

As mentioned above, you will need to have active IAM credentials that the tests will use to authenticate with AWS, and it will need to have an attached IAM policy that is allowed to perform the actions the tests will be running.

All integration tests are written to locate these credentials in $HOME/.aws/awsTestAccount.properties:

$ cat $HOME/.aws/awsTestAccount.properties

accessKey = ...
secretKey = ...

Running the Integration Tests

In order to run the integration tests along with the unit tests, you must activate the integration-tests profile

# runs both unit and integration tests
mvn install -P integration-tests