Skip to content

chore(coderd): improve tests for tar<->zip conversion#12477

Merged
johnstcn merged 5 commits into
mainfrom
cj/fileszip-tests
Mar 11, 2024
Merged

chore(coderd): improve tests for tar<->zip conversion#12477
johnstcn merged 5 commits into
mainfrom
cj/fileszip-tests

Conversation

@johnstcn
Copy link
Copy Markdown
Member

@johnstcn johnstcn commented Mar 8, 2024

STACK:
#12477 <-- you are here
#12476
#12475
#12479

  • Adds some artisanally handcrafted zip and tar archives under coderd/testdata
  • Adds test helpers to assert content of above archives
  • Updates existing tests to reference above archives

NOTE: these tests will fail until #12476 is merged in

@johnstcn johnstcn self-assigned this Mar 8, 2024
@johnstcn johnstcn marked this pull request as ready for review March 8, 2024 16:25
@johnstcn johnstcn requested review from mafredri and mtojek March 8, 2024 16:26
Copy link
Copy Markdown
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor nits, nice thorough tests!

Comment thread coderd/fileszip_test.go Outdated
Comment thread coderd/files_test.go Outdated
Comment thread coderd/files_test.go Outdated
Comment thread coderd/files_test.go Outdated
Comment thread coderd/files_test.go Outdated
Comment thread coderd/fileszip_test.go Outdated
Comment thread coderd/fileszip_test.go
func TestCreateTarFromZip(t *testing.T) {
t.Parallel()
if runtime.GOOS != "linux" {
t.Skip("skipping this test on non-Linux platform")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows is no bueno?

Copy link
Copy Markdown
Member Author

@johnstcn johnstcn Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally yes, but I'm not going to assume the presence of tar and unzip on Windows for this test :-)

Comment thread coderd/fileszip_test.go Outdated
Comment thread coderd/fileszip_test.go Outdated
Comment thread coderd/fileszip_test.go Outdated
@johnstcn johnstcn merged commit b1ecc53 into main Mar 11, 2024
@johnstcn johnstcn deleted the cj/fileszip-tests branch March 11, 2024 13:29
mtojek pushed a commit that referenced this pull request Mar 11, 2024
* improve tests for tar<->zip conversion
* set mode and modtime correctly when converting from zip to tar (#12476)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants