You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,33 +61,43 @@ $ terraform plan
61
61
$ terraform apply
62
62
```
63
63
64
+
See [development process](docs/development-process.md) for more details.
65
+
64
66
Testing the Provider
65
67
---------------------------
66
68
67
-
In order to test the provider, you can simply run `make test`.
69
+
In order to test the provider, simply run `make test`.
68
70
69
71
```sh
70
72
$ make test
71
73
```
72
74
73
-
In order to run the full suite of Acceptance tests, a running rancher system, a rancher API key and a working k8s cluster imported are needed. Also, acceptance tests are covering Rancher server upgrade, v2.3.6 and v2.4.2
75
+
In order to run the full suite of Acceptance tests, a running rancher system, a rancher API key and a working k8s cluster imported are needed. Acceptance tests cover a Rancher server upgrade, v2.3.6 and v2.4.2.
74
76
75
-
To run acceptance tests, you can simply run `make testacc`. `scripts/gotestacc.sh` will be run, deploying all needed requirements, running acceptance tests and cleanup.
77
+
To run the Acceptance tests, simply run `make testacc`. `scripts/gotestacc.sh` will be run, deploying all needed requirements, running tests and cleanup.
76
78
77
79
```sh
78
80
$ make testacc
79
81
```
80
82
81
-
Due to [network limitation](https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds) on docker for osx and/or windows, there is a way to run dockerized acceptance test.
83
+
Due to [network limitations](https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds) on Docker for osx and/or windows, there is a way to run dockerized acceptance test.
82
84
83
85
```sh
84
86
$ EXPOSE_HOST_PORTS=true make docker-testacc
85
87
```
86
88
89
+
To run the structure tests, run
90
+
91
+
```sh
92
+
$ go clean --testcache && go test -v ./rancher2
93
+
```
94
+
95
+
See [test process](docs/test-process.md) for details on release testing (_Terraform Maintainers Only_).
96
+
87
97
Branching the Provider
88
98
---------------------------
89
99
90
-
The provider is branched into two release lines that have major version alignment with Rancher 2.6 and 2.7. The `release/v2` branch with 2.0.0+ is aligned with Rancher 2.6 and `master` with 3.0.0+ is aligned with Rancher 2.7. Terraform provider fixes and new features will be available on `master` but only bug fixes will be backported to `release/v2` as necessary.
100
+
The provider is branched into two release lines that have major version alignment with Rancher 2.6 and 2.7. The `release/v2` branch with 2.0.0+ is aligned with Rancher 2.6 and `master` with 3.0.0+ is aligned with Rancher 2.7. Terraform provider fixes and new features will be available on `master` but only critical bug fixes will be backported to `release/v2`.
91
101
92
102
Aligning major provider releases with minor Rancher releases means,
Terraform has recently evolved into a spotlight infrastructure provisioning tool that is maintained by Rancher engineering. As its popularity grows, so will its open source development.
4
+
5
+
Improvements to note since Jan 2023
6
+
* Rancher2 Provider docs
7
+
* Branching into `master 3.x.x` for Rancher 2.7 clusters and `release/v2 2.x.x` for Rancher 2.6 clusters
8
+
* Scripts to test Terraform RCs locally on unix and windows
9
+
10
+
### Development Process
11
+
12
+
If you are an open source contributor,
13
+
14
+
1. Add a feature / bug fix and smoke test it
15
+
2. Add or update tests
16
+
3. Open a PR! Add detailed test steps to **Testing** on the [PR template](.github/pull_request_template.md) so Terraform maintainers know how to test your solution.
17
+
4. Get 2 PR reviews (at least 1 from a Terraform maintainer)
18
+
5. Merge your PR (a Terraform maintainer will do this if you do not have repo access)
QA has a new process to test Terraform using RCs which will enable us to better test this tool before a release is published.
6
+
7
+
### Test Process
8
+
9
+
1. Cut a Terraform RC.
10
+
11
+
Terraform RCs enable QA to test features and bug fixes _before_ the next Terraform version is released. This process is also how Rancher is tested and released. Terraform is expected to mirror Rancher's functionality and use of third party packages because it uses the Rancher API, so it's ideal and best practice to test the provider in the same way.
12
+
13
+
To cut an RC, tag the latest commit. Bump the minor version for new features and the patch version for bug fixes only.
14
+
15
+
For example, if the latest tag on `master` is `v3.0.0` and the commits since that tag contain a new feature,
16
+
17
+
```sh
18
+
$ git tag v3.1.0-rc1
19
+
$ git push upstream v3.1.0-rc1
20
+
```
21
+
22
+
If all commits since the latest tag are only bug fixes,
23
+
24
+
```sh
25
+
$ git tag v3.0.1-rc1
26
+
$ git push upstream v3.0.1-rc1
27
+
```
28
+
29
+
If the latest tag is already an RC, say `v3.0.1-rc1`,
30
+
31
+
```sh
32
+
$ git tag v3.0.1-rc2
33
+
$ git push upstream v3.0.1-rc2
34
+
```
35
+
36
+
2. Move the issue To Test
37
+
3. QA uses the test plan and the Terraform RC to test the feature or bug fix using [this script](https://github.com/rancher/terraform-provider-rancher2/blob/master/setup-provider.sh). How to instructions are included in the script.
38
+
39
+
QA will test using a downloaded binary from the RC. Using an RC asset enables us to quickly test features and bugs without waiting for Hashicorp to publish a pre-release. This script sets up the correct binary using a defined `<provider> <version>` to test updates locally.
40
+
41
+
```sh
42
+
$ ./setup-provider.sh <provider><version>
43
+
```
44
+
45
+
Example
46
+
```sh
47
+
$ ./setup-provider.sh rancher2 v3.0.0-rc1
48
+
```
49
+
50
+
There is also a [windows script](https://github.com/rancher/terraform-provider-rancher2/blob/master/setup-provider-windows.ps1) for cross-platform support.
0 commit comments