Added the script to run integration tests in spi. #232

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
4 participants
Member

elopio commented Dec 4, 2015

No description provided.

elopio added some commits Dec 1, 2015

integration-tests/scripts/spi
+set -x
+
+export GOPATH="$(mktemp -d)"
+trap "rm -rf $GOPATH"EXIT
@zyga

zyga Dec 8, 2015

Contributor

did you mean to have no space between" and EXIT?

@elopio

elopio Dec 8, 2015

Member

nop, that was a copy & paste error. Thanks for catching that.

integration-tests/scripts/spi
+
+export GOPATH="$(mktemp -d)"
+trap "rm -rf $GOPATH"EXIT
+export PATH="$PATH:$GOPATH/bin"
@zyga

zyga Dec 8, 2015

Contributor

Do you need to build anything that might be on the system already (snappy/snapd)? Perhaps $GOPATH/bin:$PATH would be better so that you always get the locally built versions?

@elopio

elopio Dec 8, 2015

Member

I don't need that atm, but it seems better to avoid future problems.

Contributor

zyga commented Dec 8, 2015

Apart from the two questions above, looks good to me

Member

elopio commented Dec 8, 2015

Thanks for the review @zyga. I pushed both changes.

+
+# Script to run the integration tests in the Snappy Product Integration.
+
+set -x
@chipaca

chipaca Dec 13, 2015

Member

is the lack of -e on purpose?

@elopio

elopio Dec 14, 2015

Member

Yes, if it exits before filling the result.json we get no information about what happened.

+results_paste="$(pastebinit results/output/artifacts/results.pyunit 2>&1)"
+cat <<EOF > spi_test_result.json
+{
+ "output": "${output_paste}",
@chipaca

chipaca Dec 13, 2015

Member

One stray " in the tests output and the json asplodes. Maybe something like
python3 -c 'import os,json; for k, v in {"output": "output_print(json.dumps({"output": "{output_paste}".format(**os.environ)}))'
(etc.). You could also use jq's env function.

@elopio

elopio Dec 14, 2015

Member

with pastebinit we either get an error because the file doesn't exist, or a link. Both cases generate a correct json. So, wouldn't it be simpler and clearer to paste also the summary so the four fields are links?

@chipaca

chipaca Dec 16, 2015

Member

Your call, I think.

@niemeyer

niemeyer Jan 5, 2016

Contributor

with pastebinit we either get an error because the file doesn't exist, or a link.

So the only possible outcome of that fiddly Python application that involves HTTP, XML configuration files, and HTML processing with regular expressions (!), is that it outputs a link or a single known error, and never any quotes? Doesn't seem very plausible.

Why not taking @chipaca's feedback and addressing the problem? Seems so easy..

@elopio

elopio Jan 6, 2016

Member

@niemeyer unless I misunderstood, @chipaca's proposal doesn't save us from using pastebinit.
I hate we have to use pastebinit. What I would like is for SPI to collect all the files we put in a well-known directory and upload them to a permanent storage that we can then consume from jenkins. But well, they told me to use pastebinit instead. 😞
So, between using bash + pastebinit and using bash + pastebinit + python, I prefer the one with less things.

Now, you raise a good point. I didn't take into account that pastebinit can fail if the server is down or something. And that error could include quotes. So I'll get to implement @chipaca's wisdom.

Contributor

niemeyer commented Jan 6, 2016

Thanks! That's the only point I was raising.. or actually, @chipaca was raising.. I just emphasized it. Ensuring all these variables are properly format should be trivial enough.

Contributor

niemeyer commented Jan 12, 2016

This is open for a month, and silent for a week. I'm closing it for the time being.. please feel free to reopen it when there is interest on the change again.

@niemeyer niemeyer closed this Jan 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment