Skip to content

Commit 2c6aed3

Browse files
committed
chore: Update 'building' section
Update the 'building/running' section of the contrib guidelines to ditch the Makefile.
1 parent f7df838 commit 2c6aed3

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,31 +86,49 @@ More examples can be found [here](https://www.conventionalcommits.org/en/v1.0.0/
8686

8787
## Code of Conduct and Shared Values
8888

89-
Before contributing, please read and approve [our Code Of Conduct](https://github.com/dynatrace/dynatrace-configuration-as-code/blob/main/CODE_OF_CONDUCT.md) outlining our shared values and expectations.
89+
Before contributing, please read and approve [our Code Of Conduct](./CODE_OF_CONDUCT.md) outlining our shared values and expectations.
9090

9191
## Building the Dynatrace Configuration as Code Tool
9292

93-
The `monaco` tool is written in [Go](https://golang.org/), so you'll need to have [installed Go](https://golang.org/dl/) to build it.
93+
This section describes how to build and test Monaco.
9494

95-
To build the tool, run `make build` in the repository root folder.
95+
### Requirements
96+
* Latest [Go] version
9697

97-
**_NOTE:_** `$GOPATH/bin` is required to be loaded in your `$PATH`
98+
[Go]: https://golang.org/
9899

99-
> This guide references the make target for each step. If you want to see the actual Go commands take a look at the [Makefile](./Makefile)
100+
### Building Monaco
101+
To build Monaco, execute the following command in the repository root folder:
102+
```shell
103+
go build ./cmd/monaco
104+
```
100105

101-
To install the tool to your machine, run `make install` in the repository root folder.
106+
This command builds the `monaco` executable which then can be executed with:
107+
```shell
108+
./monaco version
109+
```
102110

103-
This will create a `monaco` executable you can use.
111+
### Install Monaco from source
104112

105-
To build a platform-specific executable, run: `GOOS={OS} GOARCH={ARCH} make build`.
113+
To install Monaco from source, execute the following command in the repository root folder:
114+
```shell
115+
go install ./cmd/monaco
116+
```
106117

107-
For example, a Windows executable can be built with `GOOS=windows GOARCH=386 make build BINARY=monaco.exe`.
118+
This will create a `monaco` executable and install it inside the path `$GOBIN` (defaults to `$GOPATH/bin`).
108119

109120
## Testing the Dynatrace Configuration as Code Tool
110121

111-
Run the unit tests for the whole module with `make test` in the root folder.
122+
To run the unit tests for Monaco, execute the following commands in the repository root folder:
123+
```shell
124+
# Generate mock files
125+
go generate ./...
112126

113-
For convenience, single package tests can be run with `make test-package pkg={PACKAGE}` - e.g. `make test-package pkg=api`.
127+
# Execute all tests
128+
go test -tags=unit -v -race ./...
129+
```ª
130+
131+
Note: The `go generate ./...` command must only be executed if the source files changed, not on every test run.
114132
115133
### Integration Tests
116134
@@ -138,8 +156,6 @@ Instead, whenever you need to test a path, make sure to do it in one of these wa
138156
* Use the public function `ReplacePathSeparators`, which replaces path separators in a given string with `os.PathSeparator`
139157
140158
We use [github.com/stretchr/testify](github.com/stretchr/testify) as our testing library.
141-
142-
> You might still find `gotest.tools` used for asserts in a few places, as it's being replaced. If you change a test file using it, replace it.
143159
144160
We use `require` for asserting test requirements after which it makes no sense to continue - e.g. no error was returned, a slice has the expected length, pointers aren't nil, etc. - as it will fail the test immediately and exit.
145161

0 commit comments

Comments
 (0)