Skip to content

Conversation

mauriciocm9
Copy link

*Issue #16

Description of changes:

If benchmark in base commit fails, cob exit with error. This PR ignore errors in previous benchmark instead of exit with error.

What did change?:
Create a method to run previous benchmark, if benchmark fail, check for exit status 1 message.

For benchmark that use a logger, parse.ParseSet could fail due to malformed benchmark line that's why a new function for the parse is created that behave similar to the one in the library.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

main.go Outdated
if err != nil {
return nil, xerrors.Errorf("failed to parse a result of benchmarks: %w", err)
}
return s, nil
}

func runPreviousBenchmark(cmdStr string, args []string) (parse.Set, error) {
prevSet, err := runBenchmark(cmdStr, args)
if err != nil && strings.Contains(err.Error(), "exit status 1") {
Copy link

Choose a reason for hiding this comment

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

we should probably match any exit status because blocking a pipeline because of any error on previous code is not good

Copy link
Author

Choose a reason for hiding this comment

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

I think golang always return exit status 1 for any error during the execution of the test.

Copy link

@dcu dcu Feb 17, 2020

Choose a reason for hiding this comment

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

not sure... someone could call os.Exit in their tests, for example

Copy link
Author

Choose a reason for hiding this comment

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

done

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.

2 participants