Skip to content

Commit

Permalink
Add testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
matiit committed May 24, 2023
1 parent 3637bc4 commit f94795c
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 0 deletions.
7 changes: 7 additions & 0 deletions patrol/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ func TestRepo(t *testing.T) {
"should flag a package as changed",
AllFiles: true,
},
RepoTest{
TestdataFolder: "nestedassets",
Name: "change in files that are not go source files, nested",
Description: "A change to a file that is not a go source file\n" +
"should flag a sub package as changed",
AllFiles: true,
},
}

tests.Run(t)
Expand Down
9 changes: 9 additions & 0 deletions patrol/testdata/nestedassets/commits/1/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/utilitywarehouse/modules

go 1.17

require github.com/sirupsen/logrus v1.8.1

require (
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 // indirect
)
12 changes: 12 additions & 0 deletions patrol/testdata/nestedassets/commits/1/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g=
github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU=
github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
7 changes: 7 additions & 0 deletions patrol/testdata/nestedassets/commits/1/sub/migrations/001.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
9 changes: 9 additions & 0 deletions patrol/testdata/nestedassets/commits/1/sub/module.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package sub

import (
"github.com/sirupsen/logrus/hooks/writer"
)

type A struct {
writer.Hook
}
1 change: 1 addition & 0 deletions patrol/testdata/nestedassets/commits/2/changes.patrol
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github.com/utilitywarehouse/modules/sub
9 changes: 9 additions & 0 deletions patrol/testdata/nestedassets/commits/2/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/utilitywarehouse/modules

go 1.17

require github.com/sirupsen/logrus v1.8.1

require (
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 // indirect
)
12 changes: 12 additions & 0 deletions patrol/testdata/nestedassets/commits/2/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g=
github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU=
github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
8 changes: 8 additions & 0 deletions patrol/testdata/nestedassets/commits/2/sub/migrations/001.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
9 changes: 9 additions & 0 deletions patrol/testdata/nestedassets/commits/2/sub/module.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package sub

import (
"github.com/sirupsen/logrus/hooks/writer"
)

type A struct {
writer.Hook
}

0 comments on commit f94795c

Please sign in to comment.