Repository navigation
Enable folding sections when run under Travis - #2851
cognifloyd wants to merge 2 commits into
Conversation
|
Test failures are unrelated to this change. |
There was a problem hiding this comment.
Nice feature, sadly is not yet a generic terminal feature. What worries me is that in case of exceptions, the end section will never be printed, likely causing other issues, especially in cases where multiple commands are executed and some would fail.
Can we maybe catch the exceptions print them and the done bit end and raise them back?
I am also inclined to opt-in for an implementation using a decorator if possible? Using a decorator should make it much easier to wrap the start/end of it, don't you think?
|
This bit concerns me, "While not officially documented, I think you can rely on this behavior in the foreseeable future." But that was written in 2014 and appears to still be valid. So it doesn't concern me that much. Does it make sense to provide an output mechanism like this specifically just for one CI provider? Do others have similar functionality that we ought to incorporate? I have no issues with the structure of the code, unless we think we're going to be asked or expected to expand this functionality to support a bunch of other providers. |
I don't like requiring all of the commands to add an extra print function at the end. Doing this in a decorator (edit: a decorator around the What if I modified |
c57b2bd to
1ab445b
Compare
|
@ssbarnea Using a decorator seems to be much simpler. Thanks for the idea. What do you think? @greg-hellings if we do get requests to add something like this for other CI runners (I haven't seen a feature like this anywhere else), then the new wrapper isolates the CI-specific code more so that it's easy to tell what it is doing. |
86daa5c to
14b16c7
Compare
|
To test this, I just started upgrading a molecule scenario to use molecule 3.1(ish) - my upgrade is not complete, but it shows how the folding looks: Sadly, it is not very informative at the folds. I need to play with that to see if there's a way to describe the fold when it is collapsed. |
|
Ooh. That looks better. I used this chain of links to learn how to do that: |
b7da42e to
72b3f14
Compare
|
My top 3:
|
|
I would not spend much time investing in colorama as I am already working on a big change that drops it and switching to https://github.com/willmcgugan/rich |
4e18899 to
9e6b52b
Compare
9e6b52b to
749e68d
Compare
|
I squashed and rebased. Plus I've also prepared a 2.22 backport. Will there be a 2.23 release at some point? |
There was a problem hiding this comment.
That change is far from ready, being broken and not tested:
$ molecule list [18:36:45]
--> Found config file /Users/ssbarnea/.config/molecule/config.yml
travis_fold:start:default.listMolecule --> Scenario: 'default' --> Action: 'list'
travis_fold:end:default.list
Traceback (most recent call last):
File "/Users/ssbarnea/.pyenv/versions/3.8.2/bin/molecule", line 33, in <module>
sys.exit(load_entry_point('molecule', 'console_scripts', 'molecule')())
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/ssbarnea/c/a/molecule/molecule/command/list.py", line 111, in list
statuses.extend(base.execute_subcommand(scenario.config, subcommand))
TypeError: 'NoneType' object is not iterable
$ molecule list [18:36:45]
--> Found config file /Users/ssbarnea/.config/molecule/config.yml
travis_fold:start:default.listMolecule --> Scenario: 'default' --> Action: 'list'
travis_fold:end:default.list
Traceback (most recent call last):
File "/Users/ssbarnea/.pyenv/versions/3.8.2/bin/molecule", line 33, in <module>
sys.exit(load_entry_point('molecule', 'console_scripts', 'molecule')())
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/ssbarnea/.pyenv/versions/3.8.2/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/ssbarnea/c/a/molecule/molecule/command/list.py", line 111, in list
statuses.extend(base.execute_subcommand(scenario.config, subcommand))
TypeError: 'NoneType' object is not iterable
Uses a function wrapper around execute_subcommand
749e68d to
a2ffa30
Compare
| ) | ||
| ) | ||
| try: | ||
| return func(config, subcommand) |
There was a problem hiding this comment.
I missed this return here. Added. Please try again.
There was a problem hiding this comment.
For background, I discovered that I missed this in the 2.22 branch, but didn't check to see if it was also required for 3.x. Oops.
See: cognifloyd@6ddc9b2
041792d to
903762a
Compare
903762a to
ee230ba
Compare
|
I parametrized the unit test for |
|
Please rebase it, I moved molecule/ under lib/molecule. Sorry for the inconvenience. |
|
Closing due to lack of updates. Ping me if you want to reopen it. |
|
revisiting now. Please reopen. |
|
Re-submitted PR as #2967 |
Add output when molecule is running in travis-ci to make the logs easier to jump through.
Travis log folding is explained here.
PR Type