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

Broken test in urlcreator_test #796

Merged
merged 8 commits into from
Jun 8, 2020
Merged

Broken test in urlcreator_test #796

merged 8 commits into from
Jun 8, 2020

Conversation

arberiii
Copy link
Member

Fixes #753

@arberiii arberiii self-assigned this May 20, 2020
@Coteh
Copy link
Collaborator

Coteh commented May 20, 2020

Test failing due to #546, not related to this change.

@codecov
Copy link

codecov bot commented May 21, 2020

Codecov Report

Merging #796 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #796   +/-   ##
=======================================
  Coverage   52.28%   52.28%           
=======================================
  Files         126      126           
  Lines        2773     2773           
  Branches      151      151           
=======================================
  Hits         1450     1450           
  Misses       1271     1271           
  Partials       52       52           
Flag Coverage Δ
#golang 71.84% <ø> (ø)
#typescript 25.53% <ø> (ø)
Impacted Files Coverage Δ
frontend/src/component/ui/SearchBar.tsx 100.00% <ø> (ø)
backend/app/usecase/shortlink/creator.go 69.23% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ff43de...7edaf40. Read the comment docs.

@arberiii
Copy link
Member Author

Test failing due to #546, not related to this change.

If you follow the lifecycle of that particular test case, it tries to create a URL using the function creator.CreateURL with first parameter testCase.url, which is empty, and then it fails the condition that long link is non-empty and returns the ErrInvalidLongLink(longLink) which also creates an error with an empty message. Later on, that function is checked whether the alias exists.

backend/app/usecase/validator/longlink.go Outdated Show resolved Hide resolved
@magicoder10 magicoder10 added this to the 05/18 - 05/24 milestone May 21, 2020
@pull-request-size pull-request-size bot added size/XS and removed size/S labels Jun 7, 2020
@@ -51,7 +52,9 @@ func TestShortLinkCreatorPersist_CreateShortLink(t *testing.T) {
user: entity.User{
Email: "[email protected]",
},
shortLink: entity.ShortLink{},
shortLink: entity.ShortLink{
Copy link
Member Author

@arberiii arberiii Jun 7, 2020

Choose a reason for hiding this comment

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

If the long link is not provided, this test case will have an error because the long link is not provided. If any long link is provided then the test case has an error because the alias exists, as intended!

@magicoder10 magicoder10 merged commit a77ae62 into master Jun 8, 2020
@magicoder10 magicoder10 deleted the long-link-bug branch June 8, 2020 01:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Potentially broken test in urlcreator_test
4 participants