Skip to content

Commit

Permalink
test(e2e): use By method to log step
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Aug 23, 2023
1 parent 2bc4a78 commit 12fdbb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var _ = Describe("Test tdl download", FlakeAttempts(3), func() {

BeforeEach(func() {
once.Do(func() {
log.Println("collect local file hashes")
By("collect local file hashes")
Expect(filepath.WalkDir("testdata", func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
Expand All @@ -44,16 +44,16 @@ var _ = Describe("Test tdl download", FlakeAttempts(3), func() {
return nil
})).To(Succeed())

log.Println("upload files")
By("upload files")
exec(cmd, []string{"upload", "-p", "testdata"}, true)

log.Println("export uploaded files")
By("export uploaded files")
exportFile := filepath.Join(GinkgoT().TempDir(), "export.json")
exec(cmd, []string{"chat", "export", "-T", "last", "-i", strconv.Itoa(len(fileHash)), "-o", exportFile}, true)
exportBytes, err := os.ReadFile(exportFile)
Expect(err).To(Succeed())

log.Println("get chat id and remote file ids")
By("get chat id and remote file ids")
id = gjson.GetBytes(exportBytes, "id").Int()
Expect(id).NotTo(BeZero())

Expand Down

0 comments on commit 12fdbb8

Please sign in to comment.