Skip to content

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

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

Merged
merged 5 commits into from
Mar 11, 2024
Merged

Conversation

johnstcn
Copy link
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
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!

func TestCreateTarFromZip(t *testing.T) {
t.Parallel()
if runtime.GOOS != "linux" {
t.Skip("skipping this test on non-Linux platform")
Copy link
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
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 :-)

@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