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

Release 2.9.0 #1092

Merged
merged 48 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2a4dcd0
Extract mongo logic into mDB type for OplogRestore
boris-ilijic Dec 16, 2024
48c74c3
PKG-339 psmdb.cd: fix pbm build deps installation
vorsel Dec 16, 2024
c171630
Merge pull request #1071 from vorsel/release-2.8.0
vorsel Dec 17, 2024
b1fc636
PBM-1454-Configuration-file-for-all-pbm-agent-s-options (#1065)
veceraj Dec 17, 2024
8efca19
Add tests for OplogRestore.isOpForCloning
boris-ilijic Dec 17, 2024
6d496bc
PBM coverage report for functional tests
olexandr-havryliak Dec 18, 2024
2bd080e
PBM add codecov flag for unittests
olexandr-havryliak Dec 18, 2024
710dd10
Add skeleton for testing OplogRestore.Apply
boris-ilijic Dec 18, 2024
88eec87
Add ns clone tests for i, u, d operations
boris-ilijic Dec 18, 2024
81a8635
Add index replay test for OplogRestore.Apply
boris-ilijic Dec 19, 2024
f5e7af9
Fix reviewdog suggestions
boris-ilijic Dec 19, 2024
508ed8d
Merge remote-tracking branch 'origin/dev'
boris-ilijic Dec 19, 2024
7f65c29
Bump mongo-driver and mtest deps
boris-ilijic Dec 19, 2024
fc616b1
Add tests for getUUIDForNS
boris-ilijic Dec 20, 2024
197d680
Merge pull request #1073 from percona/PBM-1455-oplog-restore-tests-wi…
boris-ilijic Dec 20, 2024
13909ee
PBM e2e tests. Change base OS for tests
sandraromanchenko Dec 23, 2024
407221c
Merge pull request #1074 from percona/PBM_fix_tests
sandraromanchenko Dec 23, 2024
780d438
PBM-1455: oplog restore tests with tc (#1075)
boris-ilijic Dec 27, 2024
c683a20
PBM run tests on push event, fix docker image for tc (#1076)
olexandr-havryliak Jan 6, 2025
71ac548
PBM-1465: Selective backup/restore for sharded collections fails for …
boris-ilijic Jan 9, 2025
8f3763f
PBM-1473 - Improve PBM behavior when the log.path option is modified …
veceraj Jan 11, 2025
3dd80f5
PBM-1466 - Remove kingpin dependency from pbm cli (#1077)
veceraj Jan 15, 2025
2e3b32c
update ensure-oplog to cobra
veceraj Jan 15, 2025
7b93c52
update speed-test to cobra
veceraj Jan 15, 2025
2de824a
tidy kingpin
veceraj Jan 15, 2025
ee54fc8
vendor remove kingpin
veceraj Jan 15, 2025
58ea420
Merge pull request #1080 from percona/PBM-1466-2
veceraj Jan 16, 2025
07d1553
PBM-1478 PBM restore doesn't work by default on server with single CPU
radoslawszulgo Jan 16, 2025
795de29
PBM-14780 remove redundant spaces
radoslawszulgo Jan 16, 2025
d46e925
Merge pull request #1081 from percona/PBM-14780-pbm-restore-do-not-wo…
radoslawszulgo Jan 16, 2025
5cc0026
Fix tc main setup for oplog tests
boris-ilijic Jan 17, 2025
ddedfde
Fix flaky test for oplog restore
boris-ilijic Jan 17, 2025
0f31540
Use psmdb image for tc tests
boris-ilijic Jan 17, 2025
a0ed86d
Merge pull request #1082 from percona/fix-oplog-flaky-test
boris-ilijic Jan 17, 2025
9dd787c
PBM-14780 Adjust concurrentCollections for backup operation if there'…
radoslawszulgo Jan 23, 2025
7b57df8
Merge pull request #1084 from percona/PBM-14780-pbm-backup-does-not-w…
radoslawszulgo Jan 23, 2025
ec07d07
PBM-1466 cobra fixes (#1085)
veceraj Jan 30, 2025
efb1174
PBM-1485. Add systemd unit file for AL2023 and fix misprint (#1086)
sandraromanchenko Feb 3, 2025
50c5672
Extract WaitForBalancerOff to topo package
boris-ilijic Feb 10, 2025
5bd6f77
Expand backup with full index spec (#1088)
boris-ilijic Feb 11, 2025
2aa63f1
Merge remote-tracking branch 'origin/dev'
boris-ilijic Feb 11, 2025
cf7ceb7
Add stoping balancer logic for restore
boris-ilijic Feb 11, 2025
963c0c0
PBM CI fix branch for push event (#1089)
olexandr-havryliak Feb 11, 2025
a2e7da9
Merge remote-tracking branch 'origin/dev'
boris-ilijic Feb 11, 2025
8578070
Merge pull request #1090 from percona/PBM-1452-stop-balancer-for-restore
boris-ilijic Feb 12, 2025
e862ba8
PBM. Bump version (#1091)
sandraromanchenko Feb 13, 2025
6dc6bd6
Update golang.org/x/net due to CVE-2024-45338 (#1093)
boris-ilijic Feb 14, 2025
06640a7
PBM-1452: Expand procedure for disabling balancer (#1094)
boris-ilijic Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 53 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ on:
- "packaging/**"
- "version/**"

push:
branches:
- main
- dev
paths-ignore:
- "e2e-tests/**"
- "packaging/**"
- "version/**"

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -35,10 +44,10 @@ jobs:
psmdb: ["6.0", "7.0", "8.0"]
test: [logical, physical, incremental, external]
env:
PBM_BRANCH: ${{ github.event.inputs.pbm_branch || 'main' }}
PBM_BRANCH: ${{ github.event.inputs.pbm_branch || github.ref_name }}
GO_VER: ${{ github.event.inputs.go_ver || '1.22-bullseye' }}
PR_NUMBER: ${{ github.event.number|| github.event.inputs.pr_ver }}

MAKE_TARGET: 'build-cover'
steps:
- name: Checkout testing repo
uses: actions/checkout@v4
Expand All @@ -58,8 +67,50 @@ jobs:
docker compose run test pytest -s --junitxml=junit.xml -k ${{ matrix.test }}
working-directory: psmdb-testing/pbm-functional/pytest

- name: Fetch coverage files
run: |
docker compose run --rm golang_reports cp -r /gocoverdir/reports /test
sudo chmod -R 777 reports
working-directory: psmdb-testing/pbm-functional/pytest
if: success() || failure()

- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: reports-${{ matrix.test }}-${{ matrix.psmdb }}
path: psmdb-testing/pbm-functional/pytest/reports/
if: success() || failure()

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: "**/junit.xml"

coverage:
if: ${{ always() }}
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
- name: Download all coverage reports
uses: actions/download-artifact@v4
with:
path: reports
pattern: reports-*
merge-multiple: true
- name: Merge coverage reports
run: |
go tool covdata textfmt -i=./reports -o ./coverage.txt
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
flags: integration
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: 'codecov'
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

jobs:
Expand All @@ -21,5 +26,6 @@ jobs:
uses: codecov/codecov-action@v4
with:
file: cover.out
flags: unittests
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
18 changes: 0 additions & 18 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
name: reviewdog
on: [pull_request]
jobs:
go-test:
name: runner / go-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: test
run: go test -v ./... -covermode=atomic -coverprofile=cover.out

- name: upload coverage report
uses: codecov/codecov-action@v4
with:
file: cover.out
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

shellcheck:
name: runner / shellcheck
runs-on: ubuntu-latest
Expand Down
87 changes: 87 additions & 0 deletions cmd/pbm-agent/commands_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package main

import (
"bytes"
"os"
"strings"
"testing"

"github.com/spf13/cobra"

"github.com/percona/percona-backup-mongodb/pbm/version"
)

func TestRootCmd_NoArgs(t *testing.T) {
rootCmd, _ := setupTestCmd()
err := rootCmd.Execute()
if err == nil || !strings.Contains(err.Error(), "required flag mongodb-uri") {
t.Fatal(err)
}
}

func TestRootCmd_Config(t *testing.T) {
tmpConfig, cleanup := createTempConfigFile(`
log:
path: "/dev/stderr"
level: "D"
json: false
`)
defer cleanup()

rootCmd, _ := setupTestCmd("--config", tmpConfig)
err := rootCmd.Execute()
if err == nil || !strings.Contains(err.Error(), "required flag mongodb-uri") {
t.Fatal(err)
}
}

func createTempConfigFile(content string) (string, func()) {
temp, _ := os.CreateTemp("", "test-config-*.yaml")

_, _ = temp.WriteString(content)
_ = temp.Close()

return temp.Name(), func() {
_ = os.Remove(temp.Name())
}
}

func TestVersionCommand_Default(t *testing.T) {
rootCmd, buf := setupTestCmd("version")
err := rootCmd.Execute()
if err != nil {
t.Fatal(err)
}

output := buf.String()

if !strings.Contains(output, "Version:") {
t.Errorf("expected full version info in output, got: %s", output)
}
}

func TestVersionCommand_Short(t *testing.T) {
rootCmd, buf := setupTestCmd("version", "--short")
err := rootCmd.Execute()
if err != nil {
t.Fatal(err)
}

output := buf.String()

if !strings.Contains(output, version.Current().Short()) {
t.Errorf("expected short version info in output, got: %s", output)
}
}

func setupTestCmd(args ...string) (*cobra.Command, *bytes.Buffer) {
cmd := rootCommand()
cmd.AddCommand(versionCommand())

var buf bytes.Buffer
cmd.SetOut(&buf)
cmd.SetErr(&buf)
cmd.SetArgs(args)

return cmd, &buf
}
Loading
Loading