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

.travis.yml: make package pulls conditional. #2292

Closed
wants to merge 6 commits into from

Conversation

dot-asm
Copy link
Contributor

@dot-asm dot-asm commented Jan 26, 2017

No description provided.

Copy link
Contributor

@richsalz richsalz left a comment

Choose a reason for hiding this comment

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

once the build passes, approve.

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 6, 2017

Well, it appears that I've figured it out, i.e. it works as latest red cross from travis is unrelated. But after melt-down and make-over travis removed "profiling" information from [raw] log files. I mean earlier there were 'duration' fields recorded for each step and one could see what are the gains, but not anymore :-( I'd also like to argue in favour of configuring with no-makedepend (makedepend makes lesser sense in build-test-and-throw-away) and omitting test_fuzz in mingw tests (it's grotesquely wasteful).

@richsalz
Copy link
Contributor

richsalz commented Feb 6, 2017

I agree it's not needed to do 'make depend' on a clean CI build. But maybe doing it once finds bugs in make depend? Also agree on the others. So a preliminary plus-one from me on your PR when you do it :)

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 6, 2017

There is "fun" dependency between no-makedepend and --strict-warnings. On related note there was report that it fails to recognize gcc if it's command line doesn't have gcc in name. Anyway, rationale behind no-makedepend is that I/O seems to be expensive (for example in attempts to include Android builds quite a time was spent on just unpacking stuff, more time than just downloading it), and makedepend is a bunch of small files...

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 18, 2017

exit in before script make job "successful" and it takes less than a minute. Unfortunately one still has to load new compilers, which would be a waste... As mentioned in #2661 idea is to formulate a criteria by which to short-circuit most of the jobs pretending that they were successful. Additional criteria, i.e. in addition to easy-to-forget tag in commit, can be to tell apart merge requests and "official" repo commits.

@levitte
Copy link
Member

levitte commented Feb 18, 2017

I'm not sure what that exit 0 in the before script is supposed to accomplish. Does it stop that section there?

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 18, 2017

what that exit 0 in the before script is supposed to accomplish.

Idea is to opt-in commits for full tests, right? For this you need a way to terminate a job and mark it as "success". And you want to terminate it as early as possible. exit 0 in beginning of before script seems to allow that. So now I have to figure out how to identify opt-in tag and not call exit...

.travis.yml Outdated
exclude:
- os: linux
compiler: clang
- os: osx
compiler: gcc

before_script:
- env
- if [ "x$TRAVIS_EVENT_TYPE" == "xpull_request" -a -n "$EXTENDED_TEST" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

Why do people insist on that 'x'? Utterly unnecessary when you have quotes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't answer for people :-) For me I suppose it's kind of better-overdo-than-not... But yes, it can be omitted.

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 18, 2017

So the suggestion is to mark specific targets with EXTENTED_TEST=yes in .travis.yml and idea is to execute them only if last commit has [extended tests] tag. It's still quite wasteful in sense that it takes 40 seconds to 1 and half minute to decide if test is to be executed. It might be appropriate to reverse the logic and mark non-extended targets with REQEUIRED_TEST. It make sense to arrange order of execution so that extended and non-extended are grouped together on web page. So that you don't have figure out which one is extended, you'd only need to figure out where non-extended tests end...

exclude:
- os: linux
compiler: clang
- os: osx
compiler: gcc

before_script:
- env
Copy link
Contributor Author

@dot-asm dot-asm Feb 18, 2017

Choose a reason for hiding this comment

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

Just in case for reference. If we choose to take this path, env can be removed after a repo-commit. As you can see [extended tests] are evaluated when TRAVIS_EVENT_TYPE is pull_request. This asks for question what is TRAVIS_EVENT_TYPE when repo-commit is performed. Once we know env can be removed...

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 19, 2017

Re-based and squashed.

@levitte
Copy link
Member

levitte commented Feb 20, 2017

So the suggestion is to mark specific targets with EXTENTED_TEST=yes in .travis.yml and idea is to execute them only if last commit has [extended tests] tag. It's still quite wasteful in sense that it takes 40 seconds to 1 and half minute to decide if test is to be executed. It might be appropriate to reverse the logic and mark non-extended targets with REQEUIRED_TEST. It make sense to arrange order of execution so that extended and non-extended are grouped together on web page. So that you don't have figure out which one is extended, you'd only need to figure out where non-extended tests end...

I'm not sure I follow... What's the intended practical difference between EXTENDED_TEST and REQUIRED_TEST? Also, the .travis.yml in this PR doesn't show much how you intend this to work, all it does is exit early from before_script, but that doesn't show how you intend tests to be affected by this exercise... Yes, I know, it's still in WIP, but thing is that as long as there's just that early exit, the intention remains unclear (at least in my mind) and it becomes an academic discussion...

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 20, 2017

What's the intended practical difference between EXTENDED_TEST and REQUIRED_TEST?

None. It's just a preference question. Do we want to mark "extended" tests or do we want to mark non-extended ones in .travis.yml. I.e. goal is the same, to limit execution of same group of tests. And we can say that definition of the said group by tagging tests with EXTENDED_TEST sucks, and decide to describe the complementary group instead by tagging non-extended tests with REQUIRED_TEST. That's all.

all it does is exit early from before_script,

And that is all one can do(*). I wish it could be solved by simply not running selected subset. In dreamland commits not tagged with [extended tests] would be presented with shortened list of jobs at https://travis-ci.org/openssl/openssl/builds/203241005. But it doesn't work like that, and there is nothing we can do. Early exit is simply the way that is available to us. Once again, idea is simply to abstain from running most expensive tests by default, because it's wasteful in most cases. And wasteful not only from travis-ci resource utilization viewpoint, but it's waste of our time waiting for the outcome. By latter I mean that one of points of having ci is that you wait for its results to evaluate them, isn't it?

(*) Well, of course one can solve the problem by arranging different branches to be watched by travis. Main trunk would be with minimalistic .travis.yml, then there could be branch with extended tests. Question here is who would keep it up-to-date? What would users have to remember to do? I understand that it's probably not as complicated. But so is [skip ci], not complicated that is, but how many times people used it say with just documentation update? In other words I'd say that opt-in directly for master branch should be preferred option...

@levitte
Copy link
Member

levitte commented Feb 20, 2017

Errrr... I think there's a misunderstanding here, we seem to be talking about very different things. My concern is that if this line does exit 0, it breaks off too early, leaving you with an unconfigured build tree and will make the build fail. Can't you simply set up a variable with content depending on if [extended test] was found or not, and then use that variable where applicable?

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 20, 2017

... misunderstanding ... exit 0

exit 0 there is supposed terminate not just before_script, but whole job. And in such way that it's marked green. It should never come to configuration, let alone make... At least that's what preliminary tests have shown... Now it seems to not work anymore... Point was that jobs tagged with EXTENDED_TEST should take like 40 seconds to "complete"... Looking...

@levitte
Copy link
Member

levitte commented Feb 20, 2017

It doesn't happen because you do a git log -2, and one of the commit messages you get contains [extended test]...

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 20, 2017

Duh... Thanks!

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 20, 2017

So I've amended last commit replacing [extended tests] with ~extended tests~ and as you can see already now extended tests come out green. This also shows that if you were on the other side you can opt-in by simply amending last commit. Yes, non-extended test results would be wasted, i.e. executed twice, but overall it should be saving... Well, it's still rather wasteful, because just to come to point of decision you update and install packages and it's at least 40 seconds. Do keep in mind that it's not alternative to #2661, rather complement...

@FdaSilvaYY
Copy link
Contributor

FdaSilvaYY commented Feb 20, 2017

Suggestion : git log $TRAVIS_COMMIT_RANGE
See https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 20, 2017

Suggestion : git log $TRAVIS_COMMIT_RANGE

Cool! Thanks! I'll be having a look at ordering builds on page so that "extended" and "minimal" are not intermixed, and will incorporate the suggestion. But not today. Thanks again.

@FdaSilvaYY
Copy link
Contributor

I get an idea, while following this PR ; please check #2692...

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 21, 2017

Suggestion : git log $TRAVIS_COMMIT_RANGE

After additional consideration I'm leaning toward git log -1 $TRAVIS_COMMIT_RANGE, i.e. equivalent of gilt log -2, just more accurate. Rationale is that if you address an issue as part of review, it's not given that it classifies for expensive tests, even if request initially did. I.e. rationale is that you would still have to make judgment and explicitly opt-in even follow-up commits.

Andy Polyakov added 2 commits February 23, 2017 19:49
Since CI is engaged on per merge request basis, it can be wasteful to
run each request through all the tests, especially those resource
consuming. Idea is to mark most of tests as "extended" and provide a
way to opt-in by marking last commit with ~extended tests~ tag. It's
still not as optimal as one could wish, as decision to skip a test
still requires machine time, and is taken in configured environment,
i.e. with updates and additional packages installed.
@dot-asm dot-asm changed the title WIP: .travis.yml: make package pulls conditional. .travis.yml: make package pulls conditional. Feb 24, 2017
@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 24, 2017

This is finalized. Besides conditional package install, it limits test coverage unless last commit is tagged with [extended tests].

@levitte
Copy link
Member

levitte commented Feb 24, 2017

So, uhmmmm, if I understand correctly, the purpose of [extended test] does not just cover testing (as in running make test), but everything including building in the first place. Was that the intention? That's the effect as currently implemented.

@levitte
Copy link
Member

levitte commented Feb 24, 2017

Also, you mentioned somewhere else (email?) that the cross compiled builds could do without test_fuzz. I totally agree with that idea, +1 for adding a TESTS="-test_fuzz" on those.

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 24, 2017

purpose of [extended test] does not just cover testing (as in running make test), but everything including building in the first place. Was that the intention?

Yes. Even though you are correct implying that lack of [extended test] tag could translate to build-only thing, it makes lesser sense to compile a number of targets, sanitizers of course, without actually executing the outcome. Second counter-argument is to define bare-minimum amount of tests, as for majority of pull requests just few builds really suffice, and doing more would probably be overkill when it comes to resource consumption, i.e. it's about being cooperative. [I do wish there was a way to cancel part of jobs without them being started, or earlier than it's done now, but in a way that doesn't result in red cross]. Third counter-argument is that since you can "request" extended testing afterwards, by amending last commit and adding the tag, skipping jobs in their entirety would result in lesser waste. [I mean requesting extending testing afterwards would effectively waste resources taken for bare-minimum and skipped jobs in the initial request. If lack of [extended test] tag translated to build-only, the waste would be higher.]

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 24, 2017

cross compiled builds could do without test_fuzz

It's done implicitly in if [ -n "$CROSS_COMPILE" ]; then clause.

@levitte
Copy link
Member

levitte commented Feb 24, 2017

Yes. Even though you are correct implying that lack of [extended test] tag could translate to build-only thing, ...

Noted, and I don't disagree with that, just wanted to be clear what we mean with "test" in this context.

cross compiled builds could do without test_fuzz

It done implicitly in if [ -n "$CROSS_COMPILE" ]; then clause.

Ah. Actually, I would prefer a more explicit approach, i.e. requiring it be explicitely declared in the matrix. More explicit == less magic == goodness, in my mind.

@dot-asm
Copy link
Contributor Author

dot-asm commented Feb 24, 2017

cross compiled builds could do without test_fuzz

It done implicitly in if [ -n "$CROSS_COMPILE" ]; then clause.

Ah. Actually, I would prefer a more explicit approach, i.e. requiring it be explicitely declared in the matrix. More explicit == less magic == goodness, in my mind.

Pushed.

.travis.yml Outdated
@@ -117,7 +174,7 @@ script:
- if [ -z "$BUILDONLY" ]; then
if [ -n "$CROSS_COMPILE" ]; then
sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install wine;
export EXE_SHELL="wine" WINEPREFIX=`pwd`;
export EXE_SHELL="wine" WINEPREFIX=`pwd`
Copy link
Member

Choose a reason for hiding this comment

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

Errr, please put the ; back

Copy link
Member

Choose a reason for hiding this comment

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

([skip ci] is inconvenient at times, eh? ;-) )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. Fixed. Thanks.

Copy link
Member

@levitte levitte left a comment

Choose a reason for hiding this comment

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

I'm happy with this

levitte pushed a commit that referenced this pull request Feb 24, 2017
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from #2292)
levitte pushed a commit that referenced this pull request Feb 24, 2017
Since CI is engaged on per merge request basis, it can be wasteful to
run each request through all the tests, especially those resource
consuming. Idea is to mark most of tests as "extended" and provide a
way to opt-in by marking last commit with [extended tests] tag. It's
still not as optimal as one could wish, as decision to skip a test
still requires machine time, and it's taken in configured environment,
i.e. with updates and additional packages installed...

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from #2292)
@dot-asm dot-asm closed this Feb 24, 2017
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