Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov authored May 20, 2024
2 parents 94c6753 + 705c21f commit 83a4e0e
Show file tree
Hide file tree
Showing 50 changed files with 1,226 additions and 910 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,18 @@ jobs:
run: make test-cover

- name: Upload coverage results
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: cover.out
flags: admin
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env
go version
go env
pwd
env | sort
go env | sort
git status
cli-test:
Expand Down Expand Up @@ -161,9 +160,9 @@ jobs:
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env
go version
go env
node --version
pwd
env | sort
go env | sort
git status
node --version
npx --version
npx playwright --version
5 changes: 3 additions & 2 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Build and install
run: make install

- name: Docker-compose
- name: Launch containers
env:
ENV_UP_FLAGS: "--detach"
run: make env-up
Expand All @@ -102,12 +102,13 @@ jobs:
run: make test-cover

- name: Upload coverage results
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: cover.out
flags: agent
env_vars: MYSQL_IMAGE,MONGO_IMAGE,POSTGRES_IMAGE,PMM_SERVER_IMAGE
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

- name: Run debug commands on failure
if: ${{ failure() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
go:
- version: 1.21.x
- version: 1.22.x
may-fail: false
- version: tip
may-fail: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:

steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
uses: rtCamp/action-slack-notify@v2.2.1

workflow_failure:
if: ${{ failure() }}
Expand All @@ -169,4 +169,4 @@ jobs:

steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
uses: rtCamp/action-slack-notify@v2.2.1
3 changes: 2 additions & 1 deletion .github/workflows/managed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ jobs:
run: docker exec -i pmm-server make -C managed test-update

- name: Upload coverage results
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: managed/cover.out
flags: managed
env_vars: PMM_SERVER_IMAGE
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

- name: Cache
if: ${{ fromJSON(env.DEVCONTAINER_CACHE_ENABLED) }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ jobs:
run: docker exec pmm-update-server make -C /root/go/src/github.com/percona/pmm/update run-race-cover RUN_FLAGS='-debug -check'

- name: Upload coverage results
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: cover.out
flags: update
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

9 changes: 4 additions & 5 deletions .github/workflows/vmproxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,16 @@ jobs:
run: make test-cover

- name: Upload coverage results
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: cover.out
flags: vmproxy
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env
go version
go env
pwd
env | sort
go env | sort
git status
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This Dockerfile is used only for API tests.

FROM golang:1.21
FROM golang:1.22

RUN export GOPATH=$(go env GOPATH) && \
mkdir -p $GOPATH/src/github.com/percona/pmm
Expand Down
4 changes: 2 additions & 2 deletions admin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ test-cover: ## Run tests and collect cross-package coverage
go test $(TEST_FLAGS) -race -coverprofile=cover.out -covermode=atomic -coverpkg=./... ./...

env-up: ## Start development environment
docker-compose up --force-recreate --abort-on-container-exit --renew-anon-volumes --remove-orphans
docker compose up --force-recreate --abort-on-container-exit --renew-anon-volumes --remove-orphans

env-down: ## Stop development environment
docker-compose down --volumes --remove-orphans
docker compose down --volumes --remove-orphans

8 changes: 4 additions & 4 deletions agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ env-up: ## Start development environment
mkdir -p testdata/mysql/slowlogs
chmod -R 0777 testdata

docker-compose up $(ENV_UP_FLAGS)
docker compose up $(ENV_UP_FLAGS)

env-down: ## Stop development environment
docker-compose down --volumes --remove-orphans
docker compose down --volumes --remove-orphans

setup-dev: install ## Run pmm-agent setup in development environment
pmm-agent setup $(RUN_FLAGS) --server-insecure-tls --server-address=127.0.0.1:${PMM_DEV_SERVER_PORT} --server-username=admin --server-password=admin --paths-exporters_base=$(GOPATH)/bin --force
Expand All @@ -128,13 +128,13 @@ env-psql: ## Run psql client
docker exec -ti pmm-agent_postgres env PGPASSWORD=pmm-agent-password psql --username=pmm-agent

env-sysbench-prepare:
docker-compose exec --workdir=/sysbench/sysbench-tpcc sysbench ./tpcc.lua \
docker compose exec --workdir=/sysbench/sysbench-tpcc sysbench ./tpcc.lua \
--db-driver=pgsql --pgsql-host=postgres --pgsql-user=pmm-agent --pgsql-password=pmm-agent-password --pgsql-db=pmm-agent \
--threads=1 --time=0 --report-interval=10 \
--tables=1 --scale=10 --use_fk=0 --enable_purge=yes prepare

env-sysbench-run:
docker-compose exec --workdir=/sysbench/sysbench-tpcc sysbench ./tpcc.lua \
docker compose exec --workdir=/sysbench/sysbench-tpcc sysbench ./tpcc.lua \
--db-driver=pgsql --pgsql-host=postgres --pgsql-user=pmm-agent --pgsql-password=pmm-agent-password --pgsql-db=pmm-agent \
--threads=4 --time=0 --rate=10 --report-interval=10 --percentile=99 \
--tables=1 --scale=10 --use_fk=0 --enable_purge=yes run
6 changes: 3 additions & 3 deletions agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package config
import (
"fmt"
"io/fs"
"log"
"net"
"net/url"
"os"
Expand Down Expand Up @@ -414,10 +413,11 @@ func Application(cfg *Config) (*kingpin.Application, *string) {
}).Bool()

app.Flag("version", "Show application version").Short('v').Action(func(*kingpin.ParseContext) error {
// We use fmt instead of log package to provide proper output for --json flag.
if *jsonF {
log.Println(version.FullInfoJSON())
fmt.Println(version.FullInfoJSON()) //nolint:forbidigo
} else {
log.Println(version.FullInfo())
fmt.Println(version.FullInfo()) //nolint:forbidigo
}
os.Exit(0)

Expand Down
2 changes: 1 addition & 1 deletion agent/docker-compose-pg-load.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# docker-compose -f docker-compose-pg-load.yml up
# docker compose -f docker-compose-pg-load.yml up
version: '3.7'

services:
Expand Down
2 changes: 1 addition & 1 deletion agent/serviceinfobroker/service_info_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (sib *ServiceInfoBroker) getPostgreSQLInfo(ctx context.Context, dsn string,
if err != nil && !errors.Is(err, sql.ErrNoRows) {
res.Error = err.Error()
}
res.PgsmVersion = pgsmVersion
res.PgsmVersion = &pgsmVersion

return &res
}
Expand Down
2 changes: 1 addition & 1 deletion agent/serviceinfobroker/service_info_broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func TestServiceInfoBroker(t *testing.T) {
}, 0)
require.NotNil(t, resp)
assert.Equal(t, []string{"postgres", "pmm-agent"}, resp.DatabaseList)
assert.Equal(t, "", resp.PgsmVersion)
assert.Equal(t, "", *resp.PgsmVersion)
})

t.Run("MongoDBWithSSL", func(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions api-tests/server/advisors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestChangeSecurityChecks(t *testing.T) {
}
})

t.Run("change interval error", func(t *testing.T) {
t.Run("unrecognized interval is ignored", func(t *testing.T) {
t.Cleanup(func() { restoreCheckIntervalDefaults(t) })

resp, err := managementClient.Default.SecurityChecks.ListSecurityChecks(nil)
Expand All @@ -185,7 +185,7 @@ func TestChangeSecurityChecks(t *testing.T) {
}

_, err = managementClient.Default.SecurityChecks.ChangeSecurityChecks(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid value for enum type: \"unknown_interval\"")
require.NoError(t, err)

resp, err = managementClient.Default.SecurityChecks.ListSecurityChecks(nil)
require.NoError(t, err)
Expand Down
Loading

0 comments on commit 83a4e0e

Please sign in to comment.