Skip to content

Commit

Permalink
Add automated tests for mysql (#3)
Browse files Browse the repository at this point in the history
* Add automated tests for mysql

* Fix table style
  • Loading branch information
nhatthm authored Jan 27, 2022
1 parent 007cad2 commit 5da30ca
Show file tree
Hide file tree
Showing 13 changed files with 2,218 additions and 14 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/test-compatibility-mysql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: compatibility-test-mysql

on:
push:
branches:
- master
pull_request:

env:
GO111MODULE: "on"

jobs:
test:
strategy:
fail-fast: false
matrix:
go-version: [ 1.16.x, 1.17.x ]
arch: [ "386", amd64 ]
mysql-version: [ "8" ]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v2

- name: Go cache
uses: actions/cache@v2
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-compatibility-mysql-cache-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-compatibility-mysql-cache
- name: Test
id: test
env:
GOARCH: ${{ matrix.arch }}
COMPATIBILITY_TEST: mysql
MYSQL_VERSION: ${{ matrix.mysql-version }}
run: |
make test-compatibility
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ The traces are almost identical with some minor changes:
<tbody>
<tr>
<td colspan="2">
<code>DATA-DOG/go-sqlmock</code>
<code style="white-space: nowrap">DATA-DOG/go-sqlmock</code>
</td>
<td colspan="6" align="center">
<a href="https://github.com/nhatthm/otelsql/actions/workflows/test-unit.yaml">
Expand All @@ -564,17 +564,17 @@ The traces are almost identical with some minor changes:
</tr>
<tr>
<td colspan="2">
<code>jmoiron/sqlx</code>
<code style="white-space: nowrap">jmoiron/sqlx</code>
</td>
<td colspan="6" align="center">
<img src="https://img.shields.io/badge/manual%20test-passing-brightgreen?labelColor=3F4750&logo=target&logoWidth=10&logoColor=959DA5&color=31C754" alt="Manually Tested">
</td>
</tr>
<tr>
<td>
<code>jackc/pgx/stdlib</code>
<code style="white-space: nowrap">jackc/pgx/stdlib</code>
</td>
<td>
<td style="white-space: nowrap">
Postgres 12, 13, 14
</td>
<td colspan="6" align="center">
Expand All @@ -587,9 +587,9 @@ The traces are almost identical with some minor changes:
</tr>
<tr>
<td>
<code>lib/pq</code>
<code style="white-space: nowrap">lib/pq</code>
</td>
<td>
<td style="white-space: nowrap">
Postgres 12, 13, 14
</td>
<td colspan="6" align="center">
Expand All @@ -600,6 +600,21 @@ The traces are almost identical with some minor changes:
</a>
</td>
</tr>
<tr>
<td>
<code style="white-space: nowrap">go-sql-driver/mysql</code>
</td>
<td style="white-space: nowrap">
MySQL 8
</td>
<td colspan="6" align="center">
<a href="https://github.com/nhatthm/otelsql/actions/workflows/test-compatibility-mysql.yaml">
<img
src="https://github.com/nhatthm/otelsql/actions/workflows/test-compatibility-mysql.yaml/badge.svg?branch=master" alt="Build Status"
style="max-width: 100%;">
</a>
</td>
</tr>
<tbody>
</table>

Expand Down
101 changes: 101 additions & 0 deletions tests/mysql/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
module github.com/nhatthm/otelsql/tests/postgres

go 1.17

require (
github.com/Masterminds/squirrel v1.5.2
github.com/go-sql-driver/mysql v1.6.0
github.com/golang-migrate/migrate/v4 v4.15.1
github.com/nhatthm/go-clock v0.6.0
github.com/nhatthm/otelsql/tests/suite v0.0.0
github.com/testcontainers/testcontainers-go v0.12.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/Microsoft/hcsshim v0.9.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bool64/ctxd v1.0.0 // indirect
github.com/bool64/shared v0.1.4 // indirect
github.com/bool64/sqluct v0.1.9 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/containerd/cgroups v1.0.2 // indirect
github.com/containerd/containerd v1.5.9 // indirect
github.com/cucumber/gherkin-go/v19 v19.0.3 // indirect
github.com/cucumber/godog v0.12.4 // indirect
github.com/cucumber/messages-go/v16 v16.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v20.10.12+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/godogx/clocksteps v0.1.1 // indirect
github.com/godogx/dbsteps v0.1.2 // indirect
github.com/godogx/resource v0.1.0 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-memdb v1.3.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/iancoleman/orderedmap v0.2.0 // indirect
github.com/jmoiron/sqlx v1.3.4 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/lib/pq v1.10.4 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/moby/sys/mount v0.3.0 // indirect
github.com/moby/sys/mountinfo v0.5.0 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/nhatthm/otelsql v0.1.0 // indirect
github.com/nhatthm/timeparser v0.2.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.7.0 // indirect
github.com/swaggest/assertjson v1.6.8 // indirect
github.com/swaggest/form/v5 v5.0.1 // indirect
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/otel v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.26.0 // indirect
go.opentelemetry.io/otel/internal/metric v0.26.0 // indirect
go.opentelemetry.io/otel/metric v0.26.0 // indirect
go.opentelemetry.io/otel/sdk v1.3.0 // indirect
go.opentelemetry.io/otel/sdk/export/metric v0.26.0 // indirect
go.opentelemetry.io/otel/sdk/metric v0.26.0 // indirect
go.opentelemetry.io/otel/trace v1.3.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 // indirect
google.golang.org/grpc v1.44.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

replace (
github.com/nhatthm/otelsql => ../../
github.com/nhatthm/otelsql/tests/suite => ../suite
)
Loading

0 comments on commit 5da30ca

Please sign in to comment.