Skip to content

Commit

Permalink
Merge pull request restic#3850 from lbausch/go1.19
Browse files Browse the repository at this point in the history
Update tests to Go 1.19
  • Loading branch information
MichaelEischer committed Aug 7, 2022
2 parents 2930a10 + f3fdc66 commit 9ad3ad5
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 136 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

env:
latest_go: "1.18.x"
latest_go: "1.19.x"
GO111MODULE: on

jobs:
Expand All @@ -19,24 +19,30 @@ jobs:
# list of jobs to run:
include:
- job_name: Windows
go: 1.18.x
go: 1.19.x
os: windows-latest
install_verb: install

- job_name: macOS
go: 1.18.x
go: 1.19.x
os: macOS-latest
test_fuse: false
install_verb: install

- job_name: Linux
go: 1.18.x
go: 1.19.x
os: ubuntu-latest
test_cloud_backends: true
test_fuse: true
check_changelog: true
install_verb: install

- job_name: Linux
go: 1.18.x
os: ubuntu-latest
test_fuse: true
install_verb: install

- job_name: Linux
go: 1.17.x
os: ubuntu-latest
Expand Down Expand Up @@ -260,7 +266,7 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.45
version: v1.48
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
args: --verbose --timeout 5m
Expand Down
2 changes: 1 addition & 1 deletion internal/restic/snapshot_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ type KeepReason struct {
// according to the policy p. list is sorted in the process. reasons contains
// the reasons to keep each snapshot, it is in the same order as keep.
func ApplyPolicy(list Snapshots, p ExpirePolicy) (keep, remove Snapshots, reasons []KeepReason) {
sort.Sort(list)
sort.Stable(list)

if p.Empty() {
for _, sn := range list {
Expand Down
40 changes: 20 additions & 20 deletions internal/restic/testdata/policy_keep_snapshots_0
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,7 @@
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
"paths": null
},
{
"time": "2015-10-22T10:20:30Z",
Expand All @@ -174,12 +167,19 @@
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
Expand Down Expand Up @@ -915,14 +915,7 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
"paths": null
},
"matches": [
"policy is empty"
Expand All @@ -948,7 +941,11 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"policy is empty"
Expand All @@ -959,7 +956,10 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
Expand Down
20 changes: 10 additions & 10 deletions internal/restic/testdata/policy_keep_snapshots_18
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"paths": null,
"tags": [
"foo",
"bar"
Expand All @@ -24,7 +21,10 @@
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
Expand Down Expand Up @@ -157,10 +157,7 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"paths": null,
"tags": [
"foo",
"bar"
Expand Down Expand Up @@ -190,7 +187,10 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
Expand Down
20 changes: 10 additions & 10 deletions internal/restic/testdata/policy_keep_snapshots_19
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"paths": null,
"tags": [
"foo",
"bar"
Expand All @@ -24,7 +21,10 @@
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
Expand All @@ -45,10 +45,7 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"paths": null,
"tags": [
"foo",
"bar"
Expand Down Expand Up @@ -78,7 +75,10 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
Expand Down
20 changes: 10 additions & 10 deletions internal/restic/testdata/policy_keep_snapshots_20
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"paths": null,
"tags": [
"foo",
"bar"
Expand All @@ -24,7 +21,10 @@
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
Expand Down Expand Up @@ -165,10 +165,7 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"paths": null,
"tags": [
"foo",
"bar"
Expand Down Expand Up @@ -200,7 +197,10 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
Expand Down
40 changes: 20 additions & 20 deletions internal/restic/testdata/policy_keep_snapshots_26
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,7 @@
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
"paths": null
},
{
"time": "2015-10-22T10:20:30Z",
Expand All @@ -174,12 +167,19 @@
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
Expand Down Expand Up @@ -666,14 +666,7 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
"paths": null
},
"matches": [
"within 1y1m1d"
Expand All @@ -699,7 +692,11 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"within 1y1m1d"
Expand All @@ -710,7 +707,10 @@
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
Expand Down
Loading

0 comments on commit 9ad3ad5

Please sign in to comment.