Skip to content

Commit 64bc1c3

Browse files
committed
docs: add development instructions
1 parent b717be2 commit 64bc1c3

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,57 @@ The test object in the report includes the following [CTRF properties](https://c
146146

147147
When running go-ctrf-json-reporter results in a "command not found" error this usually means that the Go bin directory is not in your system's PATH.
148148

149+
## Development
150+
151+
Contributions are welcome! See [Contributing](CONTRIBUTING.md) for more information.
152+
153+
### Build the binary
154+
155+
```bash
156+
go build -o go-ctrf-json-reporter ./cmd/go-ctrf-json-reporter
157+
```
158+
159+
### Running Tests
160+
161+
```bash
162+
go test ./...
163+
```
164+
165+
### Testing the Reporter
166+
167+
```bash
168+
go test -json ./... | ./go-ctrf-json-reporter -output ctrf-report.json
169+
170+
cat ctrf-report.json
171+
```
172+
173+
### Development Workflow
174+
175+
1. Make changes to the code
176+
2. Run tests: `go test ./...`
177+
3. Test the reporter: `go test -json ./... | ./go-ctrf-json-reporter -output test-results.json`
178+
4. Check the generated CTRF report: `cat test-results.json`
179+
180+
### Troubleshooting
181+
182+
If you encounter issues with test execution, ensure your Go environment is set correctly for your platform:
183+
184+
```bash
185+
# Check your Go environment
186+
go env GOOS GOARCH
187+
188+
# Set for your platform if needed
189+
export GOOS=darwin GOARCH=arm64 # For macOS ARM64
190+
export GOOS=linux GOARCH=amd64 # For Linux x86_64
191+
export GOOS=windows GOARCH=amd64 # For Windows x86_64
192+
```
193+
194+
Make sure the binary is executable:
195+
196+
```bash
197+
chmod +x go-ctrf-json-reporter
198+
```
199+
149200
## What is CTRF?
150201

151202
CTRF is a universal JSON test report schema that addresses the lack of a standardized format for JSON test reports.

0 commit comments

Comments
 (0)