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
More tests #330
More tests #330
Conversation
this still contains the commits from #324… maybe you need to rebase this on master? |
308310c
to
731fc58
Compare
I'm currently just trying if/how that works (currently it doesn't...)... |
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; | ||
else | ||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe:
[[ "$TRAVIS_OS_NAME" == "osx" ]] && os=MacOSX || os=Linux
wget "https://repo.continuum.io/miniconda/Miniconda3-latest-$os-x86_64.sh" -O miniconda.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
So I think we run her into the same problems as all Mac OSx users:
https://travis-ci.org/IRkernel/IRkernel/jobs/130009741 Do you think it makes sense to ask the pbdZMQ package to statically link to the underlying lib? |
So, and then there is wondows: https://github.com/craigcitro/r-travis |
eh?
we already use that… |
Damn, wrong Link, have to find the right one again... |
@@ -7,6 +7,15 @@ bootstrap_header() { | |||
echo -e "${ANSI_YELLOW}$1${ANSI_RESET}" | |||
} | |||
|
|||
travis_fold() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this already exists when running on travis. please remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, that was a problem when I executed instead of sourced the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, then please remove the function and go back to sourcing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIR the reason for not sourcing was a problem with set -e
which terminated the whole build including the after_failure
clause in the travis script. Running it as bash script
and setting set -e fixed that.
Without set -e
you have to check each command so that the build fails if one of the steps fails (e.g. the problem you noticed that the test builds do not show that something is wrong...).
I will try to get a fix for both problems... Going back to a "travis.yml only" setup would be my preference... IMO one big travis.yml is better than a travis.yml which links to a big script. Especially if the amount of code is reduced because we don't need to reimplement most of travis' r support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also here: https://docs.travis-ci.com/user/customizing-the-build/#Implementing-Complex-Build-Steps -> calling the script with set -ev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going back to a "travis.yml only" setup would be my preference...
i tried it, but i didn’t find a way to get folding then. separate shell lines in YAML are treated as separate commands, which messes with the folding, …
maybe we can put it all in the YAML like this?
script:
- |
travis_fold start Building
bootstrap_header 'Building package'
R CMD build .
travis_fold end Building
- ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks like a great idea! Will try that, but it could be a few days until I can come back to this... I also would like to have a solution for the zmw problem on OSX first...
eec8a44
to
0d3b88c
Compare
This is usefull: https://lint.travis-ci.org/ ... |
you think so?
this is obviously wrong. travis has first-class R support. |
R is not officially supported... I had more problems which ended up not even starting a travis run... for that it was great :-) |
ah OK. btw.: don’t bother potting it all back into |
Folding is coming back... |
great! will it also fail properly or does only the return value of the last command (which would be the folding) count? |
I've also move the install steps back as my understanding of set -e and bash functions is currently, that they don't affect it: a error in one of the steps would not jump out of the function and therefore would not cancel the build. test.sh: fold_wrap() {
local header=$1; shift
local section=$1; shift
local cmd=$@
echo start $section $header
"$cmd"
local result=$?
echo end $section
return $result
}
example_command() {
set -e
echo Hallo
false
echo SHOULD NOT HAPPEN
set +e
} $ source test.sh
$ fold_wrap HEAD SEC example_command || echo "BAD"
start SEC HEAD
Hallo
SHOULD NOT HAPPEN
end SEC |
the problem isn’t (only) scrolling, it’s the obscurity of some of the lines. a folding section that says “testing R CMD check logs for warnings and errors” before something like but yeah: i veto the huge block of obscure commands with no wrapping and helpful info. i’m sure we’ll find a solution though. how about we use |
set -e seems to not work as intended in a bash function, so a error in one of the individual steps wouldn't abort the build.
As I said: I find it fine as is. I've searched through matplotlibs errors and that is a lot worse. Ask yourself: how much time do you spend scrolling vs the time you spend adding that folding (and breaking the tests for several days/weeks until we noticed)... Simple travis.yml are best and we are already way past simple... |
I'm inclined to side with simplicity here over the presentation of test runs. Folding sections of output is nice if it's convenient, but let's not spend too much time on it if that's the only obstacle. We can always come back to it later if Travis changes something or we think of a neater way to do it. |
it’s easy, it just requires to split it up into files which @JanSchulz doesn’t like to do. |
Split tests up, or split test infrastructure up? I also would rather not have a bunch of files just for running Travis. |
me neither but it’s better than having the build terminate or a messy output. @JanSchulz i’ll also do it myself if you don’t want to, i just want to make sure we’re all on the same page |
@@ -37,5 +37,68 @@ class DisplaySystem(jkt.KernelTests): | |||
{'code': '1:3', 'mime': {'text/plain':'[1] 1 2 3'}}, | |||
] | |||
|
|||
class AbstractIRKernel(jkt.KernelTests): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing it like this with a separate class for each test means that it re-discovers and then skips the base jupyter_kernel_test tests for each subclass. Is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention was that the kernel was restarted for each test... as I play with options in the tests at the end, it seems to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On 23 May 2016 at 16:43, Jan Schulz notifications@github.com wrote:
My intention was that the kernel was restarted for each test... as I play
with options it seems to do that.OK. By default JKT reuses a kernel between tests, because starting it up
and spinning it down can be slow, and the tests are written not too depend
on order. If you want to create a new kernel for each test, I'd recommend
using setUp and tearDown methods - essentially equivalent to the setUpClass
and tearDownClass methods that are already there:
https://github.com/jupyter/jupyter_kernel_test/blob/6c392ddf54a24c464fa5e07ad7fb001023f04698/jupyter_kernel_test/__init__.py#L21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I reordered... somehow the kernel tester looks like it would be a good fit for pytest fixtures :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to keep JKT at the simple common layer of unittest, but you've seen how little code it is to start a kernel, so if you want to make a pytest fixture for it, I'm fine with that. We could add it to JKT as a module.
Let's merge this with the Travis infrastructure as @JanSchulz has done it, and then you can do a PR to make the output how you want, and we can weigh up the added complexity versus the messiness of the output. |
actually i’m happy with the current tradeoff compared to the changed version. so i’d say we leave the terminating build/good output combo as it is (only merge the other changes now), or settle on a solution before we merge this, then only discuss details (but nothing fundamental) in my PR. my proposal: everything above 2-3 trivial lines goes into |
No: simple travis >> good-looking test logs The beautiful version had bugs, adding each test directly in travis.yml prevents that |
“No” won’t do 😆 This needs to be maintainable and absolutely isn’t. do you have a better idea than me how to organize this? i’m seriously not willing to merge anything as underdocumented and unclear as this. (it’s great work otherwise of course! it just needs to be clearly structured) i have to spend a few seconds on each line to find out what it does and to mentally reconstruct the rationale why it is there. slapping on comments on each individual command won’t improve this much, as it’ll lead to an even bigger, noisier block of code. if you want this merged you’ll need to agree to some solution that structures the commands into a small number of steps that can be folded and have a good description. as said: you don’t have to do it, i will, but you’ll have to agree on it beforehand. another idea: define functions in .travis.yml with ⇒ we can’t leverage |
The |
script:
- |
wrap_cmd() {
...
}
- |
some_step()
trap 'trap - ERR; return' ERR
do_stuff
idk_lol
}
...
- wrap_cmd 'Some step' some_step
- wrap_cmd ...
- ... |
Hmm, bash functions using trap statements inside a YAML file is a long way from what I'd call elegant ;-) |
that’s only because bash isn’t elegant, and swallows errors by default, and because travis isn’t elegant, and uses bash for scripting. i’m all about that elegancy though, so if you have a better idea… i’d prefer just sourcing one big bash file, this way we avoid subtle YAML encoding gotchas (if such a thing exists) and gain syntax highlighting at the cost of having one more file. what do you both think? |
I want a single line per test in the travis.yaml and certainly not a wrapper. This has the disadvantage that the log will be slightly longer and more verbose (but it's still a long way from what I know in other projects), but it is a lot less prone to failure (=current situation). And it doesn't waste developer time when this has to be implemented (e.g. I think the time we both spent on this issue arguing is more that we both will ever spent on scrolling through the log). IMO this PR is "ready to be merged" as it is. I'm not going to implement a wrapping style, feel free to do it yourself, but also make sure that it fails when one of the steps go wrong, so that we don't end up in the current situation where we basically had no tests. |
there’s also an alternative which is more clear! some_step() (
set -e
im_in_a_subshell
) |
hey, sorry to be confrontative, but you really need to read my stuff more carefully. i said multiple times that i only want you to agree on me changing stuff up afterwards, not implement it yourself. now you propose the same thing. you could simply have said from the beginning that you’re OK with whatever i do as long as i don’t create multiple files. so if you’re both OK with the following course of action, please say so and we can go ahead:
it would look like: #.travis.sh
wrap_cmd() { ... }
step_a() (
set -e
...
)
... #.travis.yml
script:
- source .travis.sh
- wrap_cmd 'Step A' step_a
- ... OK? @JanSchulz @takluyver? |
That sounds fine to me. I mean, it sounds totally crazy that you can define functions with different kinds of brackets and they work in deeply different ways, but that's bash for you. |
As I said: My vote goes to keeping it as is in this PR without putting in a wrapper and voodoo magic just for the sake of a shorter log and a few less seconds per log read. But I also don't want to waste any more time on this than I already have. If you want to spend the time:
Please also document the different kind of brackets and so on in all places, that no one is accidentally breaking it in a later change to the test system. I didn't even know that such stuff exists. |
Alright, thanks both. |
in bash, the two kinds of groupings are those: {
echo '<!doctype html><html>'
produce_html
echo '</html>'
} | expect_html_document i use subshells often interactively for this: (cd somewhere; command) which will not change my directory if the command fails. (unlike bash is fucking complex. i also didn’t know that any kind of compound command is accepted as function body, but i think everyone should know about subshells. |
No description provided.