https://github.com/ajeetdsouza/testcontainers-aerospike-go
Integration testing for Aerospike via Testcontainers.
https://github.com/ajeetdsouza/testcontainers-aerospike-go
aerospike automation docker go golang hacktoberfest integration-testing test-automation testcontainers testing
Last synced: 3 months ago
JSON representation
Integration testing for Aerospike via Testcontainers.
- Host: GitHub
- URL: https://github.com/ajeetdsouza/testcontainers-aerospike-go
- Owner: ajeetdsouza
- License: mit
- Created: 2023-08-06T19:21:28.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-06T10:45:31.000Z (about 1 year ago)
- Last Synced: 2025-02-28T04:17:59.082Z (3 months ago)
- Topics: aerospike, automation, docker, go, golang, hacktoberfest, integration-testing, test-automation, testcontainers, testing
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# testcontainers-aerospike-go
[](https://pkg.go.dev/github.com/ajeetdsouza/testcontainers-aerospike-go)
[](https://goreportcard.com/report/github.com/ajeetdsouza/testcontainers-aerospike-go)Go library for **[Aerospike](https://aerospike.com/) integration testing via
[Testcontainers](https://testcontainers.com/)**.## Install
Use `go get` to install the latest version of the library.
```bash
go get -u github.com/ajeetdsouza/testcontainers-aerospike-go@latest
```## Usage
```go
import (
"context"
"testing""github.com/stretchr/testify/require"
aero "github.com/aerospike/aerospike-client-go/v6"
aeroTest "github.com/ajeetdsouza/testcontainers-aerospike-go"
)func TestAerospike(t *testing.T) {
aeroClient := setupAerospike(t)
// your code here
}func setupAerospike(t *testing.T) *aero.Client {
ctx := context.Background()container, err := aeroTest.RunContainer(ctx)
require.NoError(t, err)
t.Cleanup(func() {
err := container.Terminate(ctx)
require.NoError(t, err)
})host, err := container.Host(ctx)
require.NoError(t, err)
port, err := container.ServicePort(ctx)
require.NoError(t, err)client, err := aero.NewClient(host, port)
require.NoError(t, err)return client
}
```