Skip to content

Commit

Permalink
test: fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed Apr 24, 2023
1 parent 88c6ef9 commit e51a3f7
Showing 1 changed file with 51 additions and 51 deletions.
102 changes: 51 additions & 51 deletions enterprise/server/remote_execution/dirtools/dirtools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ func TestUploadTree(t *testing.T) {
},
},
{
name: "SomeFiles",
name: "SomeFile",
directoryPaths: []string{},
fileContents: map[string]string{
"fileA.txt": "a",
"fileB.txt": "b",
},
symlinkPaths: map[string]string{},
expectedResult: &repb.ActionResult{
Expand All @@ -63,64 +62,49 @@ func TestUploadTree(t *testing.T) {
Hash: "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb",
},
},
{
Path: "fileB.txt",
Digest: &repb.Digest{
SizeBytes: 1,
Hash: "3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d",
},
},
},
},
expectedInfo: &dirtools.TransferInfo{
FileCount: 2,
BytesTransferred: 2,
FileCount: 1,
BytesTransferred: 1,
},
},
{
name: "FilesAndDirectories",
name: "FileAndDirectory",
directoryPaths: []string{
"a",
},
fileContents: map[string]string{
"a/fileA.txt": "a",
"a/fileB.txt": "b",
},
symlinkPaths: map[string]string{},
expectedResult: &repb.ActionResult{
OutputFiles: []*repb.OutputFile{
OutputDirectories: []*repb.OutputDirectory{
{
Path: "a/fileA.txt",
Digest: &repb.Digest{
SizeBytes: 1,
Hash: "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb",
Path: "a",
TreeDigest: &repb.Digest{
SizeBytes: 85,
Hash: "895545df6841b7efb2e9cc903a4eac7a60c645199be059f6056817ae6feb071d",
},
},
},
OutputFiles: []*repb.OutputFile{
{
Path: "a/fileB.txt",
Path: "a/fileA.txt",
Digest: &repb.Digest{
SizeBytes: 1,
Hash: "3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d",
},
},
},
OutputDirectories: []*repb.OutputDirectory{
{
Path: "a",
TreeDigest: &repb.Digest{
SizeBytes: 169,
Hash: "97014386a4164fe23b396d17ed5cf43c685f08bc8cd0dd027d23da0bc8e960c1",
Hash: "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb",
},
},
},
},
expectedInfo: &dirtools.TransferInfo{
FileCount: 3,
BytesTransferred: 168,
FileCount: 2,
BytesTransferred: 84,
},
},
{
name: "FilesAndSymlinks",
name: "SymlinkToFile",
directoryPaths: []string{},
fileContents: map[string]string{
"fileA.txt": "a",
Expand Down Expand Up @@ -157,7 +141,7 @@ func TestUploadTree(t *testing.T) {
},
},
{
name: "FilesAndSymlinksAndDirectories",
name: "SymlinkToDirectory",
directoryPaths: []string{
"a",
},
Expand All @@ -168,15 +152,6 @@ func TestUploadTree(t *testing.T) {
"linkA": "a",
},
expectedResult: &repb.ActionResult{
OutputFiles: []*repb.OutputFile{
{
Path: "a/fileA.txt",
Digest: &repb.Digest{
SizeBytes: 1,
Hash: "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb",
},
},
},
OutputDirectories: []*repb.OutputDirectory{
{
Path: "a",
Expand All @@ -186,6 +161,15 @@ func TestUploadTree(t *testing.T) {
},
},
},
OutputFiles: []*repb.OutputFile{
{
Path: "a/fileA.txt",
Digest: &repb.Digest{
SizeBytes: 1,
Hash: "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb",
},
},
},
OutputSymlinks: []*repb.OutputSymlink{
{
Path: "linkA",
Expand All @@ -206,24 +190,40 @@ func TestUploadTree(t *testing.T) {
},
{
name: "DanglingSymlink",
directoryPaths: []string{},
fileContents: map[string]string{},
directoryPaths: []string{"a"},
fileContents: map[string]string{"a/fileA.txt": "a"},
symlinkPaths: map[string]string{
"linkA": "a",
"a/linkB": "b",
},
expectedResult: &repb.ActionResult{
OutputFiles: []*repb.OutputFile{},
OutputDirectories: []*repb.OutputDirectory{},
OutputDirectories: []*repb.OutputDirectory{
{
Path: "a",
TreeDigest: &repb.Digest{
SizeBytes: 99,
Hash: "85fe6d19a6bd4cad6c5a3576929e1c894653c38da15fe44d22897e17dd44f8c6",
},
},
},
OutputFiles: []*repb.OutputFile{
{
Path: "a/fileA.txt",
Digest: &repb.Digest{
SizeBytes: 1,
Hash: "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb",
},
},
},
OutputSymlinks: []*repb.OutputSymlink{
{
Path: "linkA",
Target: "a",
Path: "a/linkB",
Target: "b",
},
},
},
expectedInfo: &dirtools.TransferInfo{
FileCount: 0,
BytesTransferred: 0,
FileCount: 2,
BytesTransferred: 98,
},
},
} {
Expand Down

0 comments on commit e51a3f7

Please sign in to comment.