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 bug with incorrect time duration of tests #66

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ladatkinS
Copy link

issue: #41

pkg/allure/result.go Outdated Show resolved Hide resolved
pkg/allure/result.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@koodeex koodeex left a comment

Choose a reason for hiding this comment

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

test


// getTimeSumOfSteps gets first step start time and last step end time
func getTimeSumOfSteps(result *Result) (startTimeInt int64, endTimeInt int64) {
startTime := result.Steps[0].Start
Copy link
Collaborator

Choose a reason for hiding this comment

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

there will be panic if Steps array is empty

Copy link
Collaborator

Choose a reason for hiding this comment

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

although, how are you going work with following case?

func TestSome(t provider.T) {
    time.Sleep(3 * time.Second)
    t.WithNewStep(...)
}

Copy link
Author

Choose a reason for hiding this comment

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

sorry,what do u mean?

func (result *Result) Print() error {
overWriteStartAndEndTime(result)
Copy link
Collaborator

Choose a reason for hiding this comment

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

if len(result.Steps) > 0 {
    overWriteStartAndEndTime(result)
}

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.

3 participants