Skip to content

Commit

Permalink
Update contributing doc (#1097)
Browse files Browse the repository at this point in the history
Provide more info to Sceptre contributors
  • Loading branch information
zaro0508 committed Sep 16, 2021
1 parent 400b488 commit 1b3c6ce
Showing 1 changed file with 45 additions and 32 deletions.
77 changes: 45 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ the project.
This project adheres to the Contributor Covenant
[code of conduct](http://contributor-covenant.org/version/1/4/). By
participating, you are expected to uphold this code. Please report unacceptable
behaviour to sceptre@cloudreach.com.
behaviour to the [Sceptre github discussion](https://github.com/Sceptre/sceptre/discussions).

# How to Contribute

## Report Bugs

Before submitting a bug, please check our
[issues page](https://github.com/cloudreach/sceptre/issues) to see if it's
[issues page](https://github.com/cloudreach/sceptre/issues) and
[discussion board](https://github.com/Sceptre/sceptre/discussions) to see if it's
already been reported.

When reporting a bug, fill out the required template, and please include as much
Expand Down Expand Up @@ -89,32 +90,51 @@ $ git clone git@github.org:<github_username>/sceptre.git
$ git checkout -b <branch-name>
```

5. When you're done making changes, check that your changes pass linting, unit
tests and have sufficient coverage and integration tests pass:
5. When you're done making changes, check that your changes pass
[linting](#Linting), [unit tests](#Unit-Tests) and have
sufficient coverage and [integration tests](#Integration-Tests)
pass.

Check linting:
6. Make sure the changes comply with the pull request guidelines in the section
on `Contributing Code`.

7. Commit and push your changes.

Commit messages should follow
[these guidelines](https://github.com/erlang/otp/wiki/Writing-good-commit-messages)

Use the following commit message format
`[Resolves #issue_number] Short description of change`.

e.g. `[Resolves #123] Fix description of resolver syntax in documentation`

8. Submit a pull request through the GitHub website.

## Linting

As a pre-deployment step we syntatically validate files with
[pre-commit](https://pre-commit.com).

Please [install pre-commit](https://pre-commit.com/#install) then run
`pre-commit install` to setup the git hooks. Once configured the pre-commit
linters will automatically run on every git commit. Alternatively you
can manually execute the validations by running
`pre-commit run --all-files`.
can manually execute the validations by running `pre-commit run --all-files`.

## Unit Tests

Run unit tests or coverage in your current environment - (handy for quickly
running unit tests):

```bash
$ make test $ make coverage
$ make test
$ make coverage
```

Note: Sceptre aims to be compatible with Python 2 & 3, please run unit test
Note: Sceptre aims to be compatible with Python 3, please run unit test
against both versions. You will need the corresponding versions of Python
installed on your system.

Run unit tests and coverage using tox for Python 3.6 and 3.7:
Run unit tests and coverage using tox for multiple Python versions:

```bash
$ tox -e py36 -e py37
Expand All @@ -123,7 +143,7 @@ $ tox -e py36 -e py37
If you use pyenv to manage Python versions, try `pip install tox-pyenv` to make
tox and pyenv play nicely.

Run integration tests:
## Integration Tests

If you haven't setup your local environment or personal CircleCI account to run
integration tests then follow these steps:
Expand All @@ -145,50 +165,43 @@ your tests are passing):
- Add your `Access Key ID` and `Secret Access Key` that is associated with an
IAM User from your AWS account. The IAM User will require "Full" permissions
for `CloudFormation` and `S3` and Write permissions for `STS` (AssumeRole).
For an example please take a look at the Sceptre
[CI service user policy](https://github.com/Sceptre/sceptre-aws/blob/master/config/prod/sceptre-integration-test-service-access.yaml#L5-L35)

Once you have set up CircleCi any time you commit to a branch in your fork all
tests will be run, including integration tests.

You can also (optionally) run the integration tests locally, which is quicker
during development.

To run integration tests locally:
### To run integration tests locally

* `pip install awscli`
* Setup [AWS CLI Environment variables](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)
to work with an AWS account that you have access to. You can use the same user
that you use for CircleCi.
* `pip install behave`

run:
_Note_: All integration tests are setup to run in `eu-west-*` region. If you prefer
to run in a different region you must update the region in each test before running it

### run all tests

```bash
$ behave integration-tests
```

or to run a specific tests:
### run a specific feature

```bash
$ behave integration-tests -n "scenario-name"
$ behave integration-tests --include <feature-file>
```

_Note_: All integration tests are setup to run in `eu-west-*` region. If you prefer
to run in a different region you must update the region in each test before running it.


6. Make sure the changes comply with the pull request guidelines in the section
on `Contributing Code`.

7. Commit and push your changes.

Commit messages should follow
[these guidelines](https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
### run a specific scenario

Use the following commit message format
`[Resolves #issue_number] Short description of change`.

e.g. `[Resolves #123] Fix description of resolver syntax in documentation`

8. Submit a pull request through the GitHub website.
```bash
$ behave integration-tests -n "<scenario-name>"
```

# Credits

Expand Down

0 comments on commit 1b3c6ce

Please sign in to comment.