Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

fix: integration tests failed #26

Merged
merged 11 commits into from
Sep 22, 2021
Merged

Conversation

junaire
Copy link
Member

@junaire junaire commented Sep 12, 2021

close #25

@junaire
Copy link
Member Author

junaire commented Sep 12, 2021

The integration tests still fails, and it keeps complaining about 400 error. I don't know why and I'm struggling with debugging go test in CLI...

I'm running the tests in the remote machine cuz there is something wrong with my local laptop, network issue I mean...

@junaire
Copy link
Member Author

junaire commented Sep 12, 2021

Looks like we almost there!

go test -race -count=1 -covermode=atomic -v ./tests
=== RUN   TestStorage
    utils_test.go:15: Setup test for gdrive

  Given a basic Storager ✔
    When String called 
      The string should not be empty ✔✔
    When Metadata called 
      The metadata should not be empty ✔✔
    When Read a file 
      The error should be nil ✘ ✔
    When Write a file 
      The first returned error should be nil ✔ ✔
    When Stat a file 
      The error should be nil ✔ ✔
    When Delete a file  ✔
    When List an empty dir 
      The error should be nil ✔✔
      The iterator should not be nil ✔✔
      The next should be done ✘✔
      The object should be nil ✘✔
    When List a dir within files 
      The error should be nil ✔ ✔
    When List without ListMode 
      The error should be nil ✔


Errors:

  * /root/go-service-gdrive/tests/storage_test.go 
  Line 14: - runtime error: index out of range [0] with length 0 
root@ubuntu-s-1vcpu-1gb-nyc1-01:~/go-service-gdrive# 

@junaire junaire changed the title fix: specify parentsId of the file fix: integration tests failed Sep 19, 2021
@junaire
Copy link
Member Author

junaire commented Sep 20, 2021

We finally made it! All tests passed now, can you please review this patch? @Xuanwo

❯ make integration_test
go test -race -count=1 -covermode=atomic -v ./tests
=== RUN   TestStorage
    utils_test.go:15: Setup test for gdrive

  Given a basic Storager ✔
    When String called 
      The string should not be empty ✔✔
    When Metadata called 
      The metadata should not be empty ✔✔
    When Read a file 
      The error should be nil ✔✔
      The content should be match ✔✔✔✔
    When Write a file 
      The first returned error should be nil ✔✔
      The second returned error also should be nil ✔✔
      Stat should get Object without error 
        The error should be nil ✔✔
        The name and size should be match ✔✔✔✔✔
      Read should get Object data without error 
        The error should be nil ✔✔
        The content should be match ✔✔✔✔
    When Stat a file 
      The error should be nil ✔✔
      The Object name and size should be match ✔✔✔✔✔
    When Delete a file 
      The first returned error should be nil ✔✔
      The second returned error also should be nil ✔✔
      Stat should get nil Object and ObjectNotFound error ✔✔✔
    When List an empty dir 
      The error should be nil ✔✔
      The iterator should not be nil ✔✔
      The next should be done ✔✔
      The object should be nil ✔✔
    When List a dir within files 
      The error should be nil ✔✔
      The iterator should not be nil ✔✔
      The name and size should be match ✔✔✔✔✔
    When List without ListMode 
      The error should be nil ✔✔
      The iterator should not be nil ✔✔
      The name and size should be match ✔✔✔✔


67 total assertions

--- PASS: TestStorage (178.26s)
=== RUN   TestCopier
    utils_test.go:15: Setup test for gdrive

  Given a basic Storager ✔
    When Copy a file 
      The error should be nil ✔✔
      Read should get dst object data without error 
        The error should be nil ✔✔
        The content should be match ✔✔✔✔
    When Copy to an existing file 
      The error should be nil ✔✔
      Read should get dst object data without error 
        The error should be nil ✔✔
        The content should be match ✔✔✔


83 total assertions

--- PASS: TestCopier (116.02s)
PASS
coverage: [no statements]
ok      github.com/beyondstorage/go-service-gdrive/tests        294.372s        coverage: [no statements]

@junaire junaire marked this pull request as ready for review September 20, 2021 03:04
@Xuanwo
Copy link
Contributor

Xuanwo commented Sep 22, 2021

image

Congrets!

@Xuanwo Xuanwo merged commit 85d32ed into beyondstorage:master Sep 22, 2021
@junaire junaire deleted the issue-25 branch September 22, 2021 02:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration test failed with invalid value
2 participants