Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage6 TEMP - Test PR #114

Open
wants to merge 8 commits into
base: pr-name-to-id-backend
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ orbs:
jobs:
build_and_test:
docker:
- image: circleci/golang:1.16
- image: circleci/golang:1.19

working_directory: /go/src/github.com/cloudspannerecosystem/harbourbridge
resource_class: large
Expand All @@ -26,23 +26,23 @@ jobs:
install-npm: true

- run: node --version

- run: cd frontend && npm install && npm run test

workflows:
version: 2

commit: # Run on every commit.
commit: # Run on every commit.
jobs:
- build_and_test

nightly: # Run every night.
nightly: # Run every night.
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
- master
jobs:
- build_and_test
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests-against-emulator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
# run tests
- uses: actions/setup-go@v2
with:
go-version: "1.16"
go-version: "1.19"
- run: go version
- run: go test -v ./...
env:
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@ on:
branches:
- master
pull_request:
name: code-coverage-check
name: code-coverage-check
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.16'
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.19"

- name: Unit tests
run: |
go test ./... -coverprofile coverage.out -covermode count
go tool cover -func coverage.out
- name: Unit tests
run: |
go test ./... -coverprofile coverage.out -covermode count
go tool cover -func coverage.out

- name: Quality Gate - Test coverage should be above threshold
env:
- name: Quality Gate - Test coverage should be above threshold
env:
TESTCOVERAGE_THRESHOLD: 50
run: |
echo "Quality Gate: checking if test coverage is above threshold ..."
echo "Threshold : $TESTCOVERAGE_THRESHOLD %"
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
echo "Current test coverage : $totalCoverage %"
if (( $(echo "$totalCoverage $TESTCOVERAGE_THRESHOLD" | awk '{print ($1 > $2)}') )); then
echo "OK"
else
echo "Current test coverage is below threshold. Please add more unit tests or adjust threshold to a lower value."
echo "Failed"
exit 1
fi
run: |
echo "Quality Gate: checking if test coverage is above threshold ..."
echo "Threshold : $TESTCOVERAGE_THRESHOLD %"
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
echo "Current test coverage : $totalCoverage %"
if (( $(echo "$totalCoverage $TESTCOVERAGE_THRESHOLD" | awk '{print ($1 > $2)}') )); then
echo "OK"
else
echo "Current test coverage is below threshold. Please add more unit tests or adjust threshold to a lower value."
echo "Failed"
exit 1
fi
10 changes: 6 additions & 4 deletions common/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,12 @@ func ReadSpannerSchema(ctx context.Context, conv *internal.Conv, client *sp.Clie
conv.Unexpected(fmt.Sprintf("error trying to fetch interleave table info from schema: %v", err))
}
// Assign parents if any.
for table, parent := range parentTables {
spTable := conv.SpSchema[table]
spTable.ParentId = parent
conv.SpSchema[table] = spTable
for tableName, parentName := range parentTables {
tableId, _ := internal.GetTableIdFromSpName(conv.SpSchema, tableName)
parentTableId, _ := internal.GetTableIdFromSpName(conv.SpSchema, parentName)
spTable := conv.SpSchema[tableId]
spTable.ParentId = parentTableId
conv.SpSchema[tableId] = spTable
}
return nil
}
Expand Down
73 changes: 66 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
module github.com/cloudspannerecosystem/harbourbridge

go 1.16
go 1.19

require (
cloud.google.com/go v0.104.0
cloud.google.com/go/dataflow v0.7.0
cloud.google.com/go/datastream v1.2.0
cloud.google.com/go/spanner v1.30.0
cloud.google.com/go/storage v1.23.0
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/aws/aws-sdk-go v1.35.3
github.com/basgys/goxml2json v1.1.0
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect
github.com/cncf/xds/go v0.0.0-20220121163655-4a2b9fdd466b // indirect
github.com/denisenkom/go-mssqldb v0.11.0
github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect
github.com/go-sql-driver/mysql v1.6.0
github.com/google/go-cmp v0.5.8
github.com/google/subcommands v1.2.0
Expand All @@ -32,9 +27,73 @@ require (
go.uber.org/zap v1.21.0
golang.org/x/crypto v0.0.0-20220214200702-86341886e292
golang.org/x/net v0.0.0-20220909164309-bea034e7d591
golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a // indirect
google.golang.org/api v0.96.0
google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006
google.golang.org/grpc v1.49.0
google.golang.org/protobuf v1.28.1
)

require (
cloud.google.com/go/compute v1.7.0 // indirect
cloud.google.com/go/iam v0.3.0 // indirect
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect
github.com/cncf/xds/go v0.0.0-20220121163655-4a2b9fdd466b // indirect
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
github.com/danjacques/gofslock v0.0.0-20191023191349-0a45f885bc37 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
github.com/googleapis/gax-go/v2 v2.5.1 // indirect
github.com/googleapis/go-type-adapters v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/opentracing/basictracer-go v1.0.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c // indirect
github.com/pingcap/failpoint v0.0.0-20220303073211-00fea37feb66 // indirect
github.com/pingcap/kvproto v0.0.0-20220328072018-6e75c12dbd73 // indirect
github.com/pingcap/log v0.0.0-20211215031037-e024ba4eb0ee // indirect
github.com/pingcap/tipb v0.0.0-20220215045658-d12dec7a7609 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/shirou/gopsutil/v3 v3.21.12 // indirect
github.com/tikv/client-go/v2 v2.0.1-0.20220406091203-f73ec0e675f4 // indirect
github.com/tikv/pd/client v0.0.0-20220307081149-841fa61e9710 // indirect
github.com/uber/jaeger-client-go v2.22.1+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opencensus.io v0.23.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading