Skip to content

Commit

Permalink
feat: fix unit test (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH authored Sep 6, 2023
1 parent a814cc2 commit 8d325fb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func Extract(tarFilePath, destinationFolder string) error {
return nil
}

return fmt.Errorf("not support file type")
return nil
}

// extract each archive in dir
Expand Down
1 change: 0 additions & 1 deletion test/service/rauc_offline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
)

func TestRAUCOfflineServer(t *testing.T) {

logger.LogInitConsoleOnly()

tmpDir, err := os.MkdirTemp("", "casaos-rauc-offline-extract-test-*")
Expand Down
4 changes: 2 additions & 2 deletions test/service/rauc_online_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ func TestRAUCServer(t *testing.T) {
release, err := installerServer.GetRelease(ctx, "unit-test-rauc-0.4.4-1")
assert.NoError(t, err)
assert.Equal(t, "v0.4.4-1", release.Version)

fmt.Println(release)
// 这个是一个假文件,只有2.6mb
releasePath, err := installerServer.DownloadRelease(ctx, *release, false)
parentDir := filepath.Dir(releasePath)

assert.NoError(t, err)
assert.FileExists(t, filepath.Join(parentDir, "casaos_ova-0.4.4-1.tar.gz"))
assert.FileExists(t, filepath.Join(parentDir, "casaos_ova-0.4.4-1.tar"))
// run shell in golang

releasePath, err = installerServer.VerifyRelease(*release)
Expand Down

0 comments on commit 8d325fb

Please sign in to comment.