Skip to content

Commit

Permalink
Update testing guide (#352)
Browse files Browse the repository at this point in the history
Signed-off-by: Taras Drozdovskyi <t.drozdovsky@samsung.com>

Adds instructions on how to install the gocov package and staticckeck tool for testing the project.
Fixes #350
  • Loading branch information
tdrozdovsky committed Aug 10, 2021
1 parent 48db83f commit d8d4518
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
16 changes: 15 additions & 1 deletion docs/platforms/x86_64_linux/x86_64_linux.md
Expand Up @@ -45,7 +45,21 @@ Please see the below [How to work](#how-to-work) to know how to run Edge Orchest
`$ export GOPATH=$HOME/go`
`$ export PATH=$PATH:$GOPATH/bin`

- extra linux utilities
- extra Go utilities: (optional)
- [gocov](https://pkg.go.dev/github.com/axw/gocov)
```
$ go get github.com/axw/gocov/gocov
```
- [gocov-html](https://github.com/matm/gocov-html#gocov-html-export)
```
$ go get github.com/matm/gocov-html
```
- [staticcheck](https://staticcheck.io)
```
$ go install honnef.co/go/tools/cmd/staticcheck@latest
```

- extra linux utilities:
```
$ sudo apt-get install tree jq
```
Expand Down
9 changes: 6 additions & 3 deletions docs/testing_policy.md
Expand Up @@ -2,7 +2,7 @@
## Contents
1. [Introduction](#1-introduction)
2. [How to start Test Suite (Local)](#2-how-to-start-test-suite-local)
2.1 [Using the system build script](#21-using-the-system-build-script)
2.1 [Using the makefile](#21-using-the-makefile)
2.2 [Using standard Go language facilities](#22-using-standard-go-language-facilities)
3. [Automated Run Test Suite (Remote)](#3-automated-run-test-suite-remote)

Expand All @@ -22,8 +22,10 @@ The Edge Orchestration team strongly recommends adhering to the [Test-driven dev
---

## 2. How to start Test Suite (Local)
There are two ways to test:

> Make sure the `gocov` and `gocov-html` packages are installed [(How to install)](https://github.com/matm/gocov-html#installation)
There are two ways to test:
### 2.1 Using the makefile
To start testing all packages:
```
Expand All @@ -43,7 +45,8 @@ To start testing a specific package:
```
$ go test -v [PKG_NAME]
```



---

## 3. Automated Run Test Suite (Remote)
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Expand Up @@ -9,6 +9,7 @@ require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/axw/gocov v1.0.0 // indirect
github.com/casbin/casbin v1.9.1
github.com/containerd/containerd v1.4.1-0.20201117152358-0edc412565dc // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
Expand All @@ -28,6 +29,7 @@ require (
github.com/grandcat/zeroconf v1.0.0
github.com/imdario/mergo v0.3.11 // indirect
github.com/leemcloughlin/logfile v0.0.0-20201123203928-cff1c8a30a10
github.com/matm/gocov-html v0.0.0-20200509184451-71874e2e203b // indirect
github.com/mattn/go-shellwords v1.0.10 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
Expand Down

0 comments on commit d8d4518

Please sign in to comment.