1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-16 04:44:55 +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

@ -1,14 +1,14 @@
PROGRAM_NAME = antelope-api-healthcheck
export PROGRAM_VERSION = 1.4.6
PROGRAM_NAME = antelope-api-healthcheck
export PROGRAM_VERSION = 1.4.6
GO = go
GO = go
PREFIX = /usr/local
export GOOS = $(shell $(GO) env GOOS)
export GOARCH = $(shell $(GO) env GOARCH)
GOBUILDFLAGS = -v -ldflags='-v -s -w -X main.VersionString=$(PROGRAM_VERSION)'
export GOARCH = $(shell $(GO) env GOARCH)
GOBUILDFLAGS = -v -ldflags='-v -s -w -X main.VersionString=$(PROGRAM_VERSION)'
DPKG_BUILDPACKAGE = dpkg-buildpackage
DPKG_BUILDPACKAGE = dpkg-buildpackage
DPKG_BUILDPACKAGE_FLAGS = -b -uc
.PHONY: all build/$(PROGRAM_NAME) build/antelope-v1-mock-server clean package_debian

View file

@ -7,12 +7,12 @@ This program implements Antelope healthcheck for HAProxy over TCP.
## 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
```sh
$ ./compile.sh
./compile.sh
```
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)
}