8000 Fold Travis CI output by component by maidmaid · Pull Request #22252 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fold Travis CI output by component #22252

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

Closed
wants to merge 10 commits into from
Closed

Conversation

maidmaid
Copy link
Contributor
@maidmaid maidmaid commented Apr 3, 2017
Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Travis CI has a feature that allows fold in tests output. For better tests readability, I propose to fold all components output that have successful result.

@stof
Copy link
Member
stof commented Apr 3, 2017

wouldn't your change also fold in case of failure ?

@maidmaid
Copy link
Contributor Author
maidmaid commented Apr 3, 2017

Yes, but it's [WIP], I notify you when I have a good changes :)

@maidmaid maidmaid force-pushed the travisci-output branch 6 times, most recently from 0b51977 to c8a20a0 Compare April 3, 2017 14:42
@maidmaid
Copy link
Contributor Author
maidmaid commented Apr 3, 2017

@stof could you help me please? I want this result:

travis_fold:start:src.Symfony.Bridge.PhpUnit
[... composer update output ... ]
[... phpunit output ... ]
travis_fold:end:src.Symfony.Bridge.PhpUnit

but [... composer update output ... ] is the first output. I suspect parallel command. Do you have an idea?

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Apr 4, 2017

maybe redirect stderr to stdout?
also note that when you're ready, this should be rebased on 2.7

@nicolas-grekas nicolas-grekas added this to the 2.7 milestone Apr 4, 2017
@maidmaid maidmaid changed the base branch from master to 2.7 April 5, 2017 09:28
@maidmaid
Copy link
Contributor Author
maidmaid commented Apr 5, 2017

Where is Travis CI? 😕

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Apr 5, 2017

I guess you need to push force again (after a commit --amend)

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Apr 5, 2017

looks like it's almost working :)
my 2cts: would be great to have two folds per component: one for composer, one for phpunit - and would be great to have failing folds be opened (either composer or phpunit, ie the one that is failing)

@maidmaid
Copy link
Contributor Author
maidmaid commented Apr 5, 2017

Ok @nicolas-grekas, I will see to do that :)

@maidmaid maidmaid force-pushed the travisci-output branch 3 times, most recently from 4505897 to 1b96ef6 Compare April 6, 2017 11:06
@maidmaid
Copy link
Contributor Author
maidmaid commented Apr 6, 2017

Here current result:

screenshot from 2017-04-06 13-04-00

WDYT?

@nicolas-grekas
Copy link
Member

Looks nice!
what about a "fold" shell script in the .github folder, that would take a label as first arg, then a command ?

allowing someting like this to work (note that I removed folding for HHVM because I think we don't need it):

- if [[ ! $deps && ! $PHP = hhvm* ]]; then echo "$COMPONENTS" | parallel --gnu 'fold {} $PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi
- if [[ ! $deps && ! $PHP = hhvm* ]]; then fold PHPUnit.tty $PHPUNIT --group tty; fi
- if [[ ! $deps && $PHP = hhvm* ]]; then $PHPUNIT --exclude-group benchmark,intl-data; fi
- if [[ ! $deps && $PHP = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | xargs -I{} fold PHPUnit.sigchild sh -c 'ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi
- if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% fold {} sh -c 'cd {}; fold Composer composer update --no-progress --no-suggest --ansi && fold PHPUnit $PHPUNIT --exclude-group tty,benchmark,intl-data$LEGACY'; fi
- if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% fold  {} sh -c 'cd {}; fold Composer composer update --no-progress --no-suggest --ansi --prefer-lowest --prefer-stable && fold PHPUnit $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi

.travis.yml Outdated
@@ -84,11 +84,12 @@ install:
- if [[ ! $skip && ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi

script:
- REPORT=' && echo -e "\\e[32mOK\\e[0m {}\\n\\n" || (echo -e "\\e[41mKO\\e[0m {}\\n\\n" && $(exit 1))'
- FOLD_START='echo "travis_fold:start:$FOLD"; echo -e "\\e[32m$FOLD\\e[0m"'
- FOLD_END='echo "travis_fold:end:$FOLD"'
Copy link
Member

Choose a reason for hiding this comment

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

such config lines should be moved in the previous "install" section

@maidmaid
Copy link
Contributor Author

Ok for fold shell script. But in your code example, you have forget to end folding no? Instead:

- - if [[ ! $deps && ! $PHP = hhvm* ]]; then fold PHPUnit.tty $PHPUNIT --group tty; fi
+ - if [[ ! $deps && ! $PHP = hhvm* ]]; then fold PHPUnit.tty $PHPUNIT --group tty fold_end; fi

@nicolas-grekas
Copy link
Member

There is no need for the end script if start/end magic string are handled inside the script in fact.

@maidmaid
Copy link
Contributor Author

Resume of changes:

  • fold shell script is created,
  • shell function is renamed to tfold (to avoid collisions with fold unix command),
  • output keeps alphabetic order (thanks to parallel -k),
  • fold title is in blue for better readability.

screenshot from 2017-04-13 21-14-02

@maidmaid maidmaid changed the title [WIP] Fold Travis CI output by component Fold Travis CI output by component Apr 13, 2017
@nicolas-grekas nicolas-grekas self-requested a review April 17, 2017 20:45
@nicolas-grekas
Copy link
Member

Thank you @maidmaid
I took over in #22461 to add a rewrite of the .travis.yml file on top of your commit.

fabpot added a commit that referenced this pull request Apr 19, 2017
…ekas)

This PR was merged into the 2.7 branch.

Discussion
----------

Fold Travis CI output by component

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Trying some tweaks on top of #22252

Commits
-------

cf87678 Make .travis.yml more readable
7a9b086 Fold Travis CI output by component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0