| load("//bazel/go:go_test.bzl", "go_test") |
| load("@io_bazel_rules_go//go:def.bzl", "go_library") |
| |
| go_library( |
| name = "migrations", |
| srcs = ["migrations.go"], |
| importpath = "go.skia.org/infra/perf/go/sql/migrations", |
| visibility = ["//visibility:public"], |
| deps = [ |
| "//go/skerr", |
| "@com_github_golang_migrate_migrate_v4//:migrate", |
| "@com_github_golang_migrate_migrate_v4//database/cockroachdb", |
| "@com_github_golang_migrate_migrate_v4//source/file", |
| "@com_github_golang_migrate_migrate_v4//source/httpfs", |
| ], |
| ) |
| |
| go_test( |
| name = "migrations_test", |
| srcs = ["migrations_test.go"], |
| data = ["//perf/migrations:cockroachdb"], |
| embed = [":migrations"], |
| # Perf CockroachDB tests fail intermittently when running locally (i.e. not on RBE) due to tests |
| # running in parallel against the same CockroachDB instance: |
| # |
| # pq: relation "schema_lock" already exists |
| # |
| # This is not an issue on RBE because each test target starts its own emulator instance. |
| # |
| # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes-tests |
| flaky = True, |
| deps = [ |
| "//go/emulators", |
| "//go/testutils/unittest", |
| "//perf/go/sql/migrations/cockroachdb", |
| "@com_github_stretchr_testify//assert", |
| "@com_github_stretchr_testify//require", |
| ], |
| ) |