Skip to content

Commit 89bb023

Browse files
committed
docs: clean up current contributing guide
1 parent 66472b0 commit 89bb023

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

CONTRIBUTING.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,51 @@
11
# Contributing
22

3-
To create a new module, clone this repository and run:
3+
## Getting started
4+
5+
This repo uses the [Bun runtime](https://bun.sh/) to to run all code and tests. To install Bun, you can run this command on Linux/MacOS:
6+
7+
```shell
8+
curl -fsSL https://bun.sh/install | bash
9+
```
10+
11+
Or this command on Windows:
12+
13+
```shell
14+
powershell -c "irm bun.sh/install.ps1 | iex"
15+
```
16+
17+
Follow the instructions to ensure that Bun is available globally. Once Bun has been installed, clone this repository. From there, run this script to create a new module:
418

519
```shell
6-
./new.sh MODULE_NAME
20+
./new.sh NAME_OF_NEW_MODULE
721
```
822

923
## Testing a Module
1024

25+
> **Note:** It is the responsibility of the module author to implement tests for their module. The author must test the module locally before submitting a PR.
26+
1127
A suite of test-helpers exists to run `terraform apply` on modules with variables, and test script output against containers.
1228

13-
The testing suite must be able to run docker containers with the `--network=host` flag, which typically requires running the tests on Linux as this flag does not apply to Docker Desktop for MacOS and Windows. MacOS users can work around this by using something like [colima](https://github.com/abiosoft/colima) or [Orbstack](https://orbstack.dev/) instead of Docker Desktop.
29+
The testing suite must be able to run docker containers with the `--network=host` flag. This typically requires running the tests on Linux as this flag does not apply to Docker Desktop for MacOS and Windows. MacOS users can work around this by using something like [colima](https://github.com/abiosoft/colima) or [Orbstack](https://orbstack.dev/) instead of Docker Desktop.
1430

15-
Reference existing `*.test.ts` files for implementation.
31+
Reference the existing `*.test.ts` files to get an idea for how to set up tests.
32+
33+
You can run all tests in a specific file with this command:
1634

1735
```shell
18-
# Run tests for a specific module!
1936
$ bun test -t '<module>'
2037
```
2138

39+
Or run all tests by running this command:
40+
41+
```shell
42+
$ bun test
43+
```
44+
2245
You can test a module locally by updating the source as follows
2346

2447
```tf
2548
module "example" {
2649
source = "git::https://github.com/<USERNAME>/<REPO>.git//<MODULE-NAME>?ref=<BRANCH-NAME>"
2750
}
2851
```
29-
30-
> **Note:** This is the responsibility of the module author to implement tests for their module. and test the module locally before submitting a PR.

0 commit comments

Comments
 (0)