Skip to content
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

fix(ci): unittest failed #2908

Merged
merged 2 commits into from
Aug 15, 2022
Merged

fix(ci): unittest failed #2908

merged 2 commits into from
Aug 15, 2022

Conversation

bojiang
Copy link
Member

@bojiang bojiang commented Aug 15, 2022

No description provided.

@bojiang bojiang requested a review from a team as a code owner August 15, 2022 07:51
@bojiang bojiang requested review from jjmachan and sauyon and removed request for a team August 15, 2022 07:51
@codecov
Copy link

codecov bot commented Aug 15, 2022

Codecov Report

Merging #2908 (c7e998a) into main (3ec89ec) will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2908      +/-   ##
==========================================
+ Coverage   70.88%   70.93%   +0.05%     
==========================================
  Files         103      103              
  Lines        9335     9334       -1     
==========================================
+ Hits         6617     6621       +4     
+ Misses       2718     2713       -5     
Impacted Files Coverage Δ
bentoml/_internal/runner/strategy.py 84.21% <0.00%> (-0.28%) ⬇️
bentoml/_internal/resource.py 76.96% <0.00%> (+2.42%) ⬆️
bentoml/_internal/utils/uri.py 89.47% <0.00%> (+5.26%) ⬆️

@bojiang bojiang changed the title fix(ci): try to cheat the unittest fix(ci): unittest failed Aug 15, 2022
Comment on lines +80 to +86
time.sleep(1)
DummyItem.create("test:otherprefix")
time.sleep(1)
DummyItem.create(Tag("test", "version2"))
time.sleep(1)
DummyItem.create("test:version3", creation_time=oldtime)
time.sleep(1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

No other better options? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering why this issue didn't surface earlier

Copy link
Collaborator

@ssheng ssheng Aug 15, 2022

Choose a reason for hiding this comment

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

It seems to be pertinent to Windows so it may have to do with the OS clock API?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it may be fine to mock creation_time here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just open this PR on behalf of sauyon's suggestion. The current CI is broken, which false-positive all current PRs. But it seems that there's more issue in the unittest about tag version.
Let me hand it over to sauyon

Copy link
Member Author

@bojiang bojiang Aug 15, 2022

Choose a reason for hiding this comment

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

@ssheng BTW to me mock creation_time will also decrease the coverage literally. Deciding the creation_time according to real-world time is an important part of the logic

Copy link
Collaborator

@ssheng ssheng Aug 15, 2022

Choose a reason for hiding this comment

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

@bojiang for unit testing the StoreItem creation logic, passing creation_time is probably not losing coverage. As discussed offline, let's get this merged and optimize the test separately. cc: @sauyon

Copy link
Contributor

Choose a reason for hiding this comment

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

I remember now we tried to fix this by overwriting latest if the timestamp is the same.

I'm really not sure what's happening here...

@bojiang bojiang enabled auto-merge (squash) August 15, 2022 09:02
@aarnphm aarnphm disabled auto-merge August 15, 2022 10:00
@ssheng ssheng merged commit f9997c5 into bentoml:main Aug 15, 2022
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.

None yet

4 participants