From 9ba373d94372f13e68970536d9f6227fc4ddd437 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Mon, 1 May 2023 11:33:29 +0200 Subject: [PATCH] coverage: Remove sonar coverage setup Looks like this never was really enabled properly and it's not working at the moment. We never run these jobs on branches and the badge for sonarcloud is broken as well. Let's remove this for now. If we want coverage back, we need to redo it anyway and newer Go releases like Go 1.20 have better support for doing coverage anyway so we'd need to do it differently regardless. Signed-off-by: Dirkjan Bussink --- .github/workflows/sonar_analysis.yml | 58 --------------------------- README.md | 2 - tools/coverage-go/Readme.md | 6 --- tools/coverage-go/mysqlctl_test.go | 22 ---------- tools/coverage-go/vtctl_test.go | 24 ----------- tools/coverage-go/vtctlclient_test.go | 7 ---- tools/coverage-go/vtctld_test.go | 22 ---------- tools/coverage-go/vtgate_test.go | 22 ---------- tools/coverage-go/vttablet_test.go | 25 ------------ 9 files changed, 188 deletions(-) delete mode 100644 .github/workflows/sonar_analysis.yml delete mode 100644 tools/coverage-go/Readme.md delete mode 100644 tools/coverage-go/mysqlctl_test.go delete mode 100644 tools/coverage-go/vtctl_test.go delete mode 100644 tools/coverage-go/vtctlclient_test.go delete mode 100644 tools/coverage-go/vtctld_test.go delete mode 100644 tools/coverage-go/vtgate_test.go delete mode 100644 tools/coverage-go/vttablet_test.go diff --git a/.github/workflows/sonar_analysis.yml b/.github/workflows/sonar_analysis.yml deleted file mode 100644 index 7887628f0be..00000000000 --- a/.github/workflows/sonar_analysis.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: sonar_analysis -on: - push: - branches: - - 'sonartest' -permissions: read-all -jobs: - - build: - runs-on: ubuntu-22.04 - - steps: - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.20.3 - - - name: Tune the OS - run: | - sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535" - - - name: Check out code - uses: actions/checkout@v3 - - - name: Get dependencies - run: | - sudo apt-get update - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata - sudo service mysql stop - sudo service etcd stop - sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ - sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld - go mod download - - - name: Execute unit test and cluster endtoend test - run: | - eatmydata -- ./tools/all_test_for_coverage.sh - mkdir report - cp /tmp/*.out ./report/. - - - name: Analyse sonar - run: | - export SONAR_SCANNER_VERSION=4.2.0.1873 - export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux - curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - export PATH=$SONAR_SCANNER_HOME/bin:$PATH - export SONAR_SCANNER_OPTS="-server" - - sonar-scanner \ - -Dsonar.projectKey=vitessio \ - -Dsonar.organization=vitess \ - -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.login=${SONAR_TOKEN} \ - -Dsonar.go.coverage.reportPaths=report/*.out - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/README.md b/README.md index ed2d8d80404..6f021141aca 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.vitess/vitess-jdbc/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.vitess/vitess-jdbc) -[![Build Status](https://travis-ci.org/vitessio/vitess.svg?branch=master)](https://travis-ci.org/vitessio/vitess/builds) [![codebeat badge](https://codebeat.co/badges/51c9a056-1103-4522-9a9c-dc623821ea87)](https://codebeat.co/projects/github-com-youtube-vitess) [![Go Report Card](https://goreportcard.com/badge/vitess.io/vitess)](https://goreportcard.com/report/vitess.io/vitess) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fvitessio%2Fvitess.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fvitessio%2Fvitess?ref=badge_shield) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1724/badge)](https://bestpractices.coreinfrastructure.org/projects/1724) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=vitessio&metric=coverage)](https://sonarcloud.io/dashboard?id=vitessio) # Vitess diff --git a/tools/coverage-go/Readme.md b/tools/coverage-go/Readme.md deleted file mode 100644 index 58d27615d7a..00000000000 --- a/tools/coverage-go/Readme.md +++ /dev/null @@ -1,6 +0,0 @@ -#### Purpose - -- To get the coverage when we run the end to end testcase,we need instrumented binaries. -- To get such binaries, we have to put a test file under go/cmd/, so that if we execute `go test ... -c .. -o ..` command, it will produce such files. -- This directory contains the test files which will copied to go/cmd/ via some script and then it instrumented binaries will be produced. -- The end to end test can be configured to run in coverage mode, which will utilize the binaries to produce coverage report. \ No newline at end of file diff --git a/tools/coverage-go/mysqlctl_test.go b/tools/coverage-go/mysqlctl_test.go deleted file mode 100644 index f3d6876a2d4..00000000000 --- a/tools/coverage-go/mysqlctl_test.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2019 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package main - -import "testing" - -func TestMysqlCtl(t *testing.T) { - main() -} diff --git a/tools/coverage-go/vtctl_test.go b/tools/coverage-go/vtctl_test.go deleted file mode 100644 index db215e48a6f..00000000000 --- a/tools/coverage-go/vtctl_test.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2019 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package main - -import ( - "testing" -) - -func TestVtctl(t *testing.T) { - main() -} diff --git a/tools/coverage-go/vtctlclient_test.go b/tools/coverage-go/vtctlclient_test.go deleted file mode 100644 index 4e78872b67a..00000000000 --- a/tools/coverage-go/vtctlclient_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "testing" - -func TestVtclient(t *testing.T) { - main() -} diff --git a/tools/coverage-go/vtctld_test.go b/tools/coverage-go/vtctld_test.go deleted file mode 100644 index eaa7ebda1e5..00000000000 --- a/tools/coverage-go/vtctld_test.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2019 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package main - -import "testing" - -func TestVtctld(t *testing.T) { - main() -} diff --git a/tools/coverage-go/vtgate_test.go b/tools/coverage-go/vtgate_test.go deleted file mode 100644 index c3601fc0372..00000000000 --- a/tools/coverage-go/vtgate_test.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2019 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package main - -import "testing" - -func TestVtgate(t *testing.T) { - main() -} diff --git a/tools/coverage-go/vttablet_test.go b/tools/coverage-go/vttablet_test.go deleted file mode 100644 index 2fc3525ad11..00000000000 --- a/tools/coverage-go/vttablet_test.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2019 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "testing" -) - -func TestVttablet(t *testing.T) { - main() -}