1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-07-04 12:03:43 +02:00

Merge branch 'dev'

This commit is contained in:
Henrik Hautakoski 2025-04-29 06:05:23 +02:00
commit efa0e71f03
3 changed files with 45 additions and 8 deletions

View file

@ -7,12 +7,12 @@ This program implements Antelope healthcheck for HAProxy over TCP.
## Compiling ## Compiling
You will need go-lang version `1.16` or later to compile the source. You will need golang version `1.16` or later to compile the source.
compile with `compile.sh` script compile with `compile.sh` script
```sh ```sh
$ ./compile.sh ./compile.sh
``` ```
Execute `./compile.sh --help` to see all available flags to crosscompile for different systems/architectures. Execute `./compile.sh --help` to see all available flags to crosscompile for different systems/architectures.

37
internal/api/make_test.go Normal file
View file

@ -0,0 +1,37 @@
package api
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestMakeV1(t *testing.T) {
api, err := Make("v1", ApiArguments{})
assert.NoError(t, err)
assert.IsType(t, AntelopeV1{}, api)
}
func TestMakeV2(t *testing.T) {
api, err := Make("v2", ApiArguments{})
assert.NoError(t, err)
assert.IsType(t, AntelopeV2{}, api)
}
func TestMakeAtomic(t *testing.T) {
api, err := Make("atomic", ApiArguments{})
assert.NoError(t, err)
assert.IsType(t, AtomicAsset{}, api)
}
func TestMakeDebug(t *testing.T) {
api, err := Make("debug", ApiArguments{})
assert.NoError(t, err)
assert.IsType(t, DebugApi{}, api)
}
func TestMakeInvalid(t *testing.T) {
api, err := Make("invalid", ApiArguments{})
assert.Error(t, err)
assert.Nil(t, api)
}