Skip to content

Commit

Permalink
Allow running integration tests with older Trino versions
Browse files Browse the repository at this point in the history
Test with oldest supported Trino version in CI
  • Loading branch information
nineinchnick authored and losipiuk committed Mar 3, 2023
1 parent a6ce3dc commit 1ea6571
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ jobs:
fail-fast: false
matrix:
go: ['>=1.20', '1.17']
trino: ['latest', '372']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- run: go test -v -race -timeout 2m ./...
- run: go test -v -race -timeout 2m ./... -trino_image_tag=${{ matrix.trino }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ A [Trino](https://trino.io) client for the [Go](https://golang.org) programming
## Requirements

* Go 1.17 or newer
* Trino 0.16x or newer
* Trino 372 or newer

## Installation

Expand Down
10 changes: 9 additions & 1 deletion trino/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ var (
pool *dt.Pool
resource *dt.Resource

trinoImageTagFlag = flag.String(
"trino_image_tag",
os.Getenv("TRINO_IMAGE_TAG"),
"Docker image tag used for the Trino server container",
)
integrationServerFlag = flag.String(
"trino_server_dsn",
os.Getenv("TRINO_SERVER_DSN"),
Expand Down Expand Up @@ -74,10 +79,13 @@ func TestMain(m *testing.M) {
resource, ok = pool.ContainerByName(name)

if !ok {
if *trinoImageTagFlag == "" {
*trinoImageTagFlag = "latest"
}
resource, err = pool.RunWithOptions(&dt.RunOptions{
Name: name,
Repository: "trinodb/trino",
Tag: "latest",
Tag: *trinoImageTagFlag,
Mounts: []string{wd + "/etc:/etc/trino"},
})
if err != nil {
Expand Down

0 comments on commit 1ea6571

Please sign in to comment.