[asterisk-dev] [Code Review]: TestSuite archiving of Asterisk logs on test run failure
mjordan
reviewboard at asterisk.org
Tue Sep 13 08:03:43 CDT 2011
> On Sept. 12, 2011, 3:20 p.m., Paul Belanger wrote:
> > /asterisk/trunk/runtests.py, line 194
> > <https://reviewboard.asterisk.org/r/1431/diff/1/?file=20561#file20561line194>
> >
> > How about a symlink? Seems like a waste to copy it.
>
> mjordan wrote:
> You wouldn't want a symbolic link, as the thing that you link to is apparently being deleted by the test harness. We'd have a dangling link otherwise. If we aren't deleting the Asterisk logs between runs, then yes, a symbolic link would suffice here.
>
> Paul Belanger wrote:
> Well, we actually delete the testsuite directory and runtests.py before the /tmp/asterisk-testsuite folder, so symlinking is not an issue. We also have bamboo copy the files into the artifact directory before we at to this point too.
>
> mjordan wrote:
> I'm confused.
>
> Either we have the original Asterisk logs, or we don't. If we have the original Asterisk logs, then creating symbolic links is all find and good, but is merely a 'nice to have'. I was under the impression that we had no way to get the Asterisk logs after a test run. If that's not the case, then this is a nice to have, but not needed, patch to debug the voicemail tests that have been bouncing.
>
> If we don't have the Asterisk logs, e.g., everything in the /tmp/asterisk-testsuite/ directory is deleted, then symbolic links would be no bueno, and we need to copy the files. Whether or not the place the test copies them to is later manipulated by bamboo in someway (moving them yet again, etc.) is superfluous from the test's perspective - currently, our place for putting log results is in the .logs\ directory.
>
>
> mjordan wrote:
> er, that should be .\logs\ directory, but I think you know what I meant :-)
>
> Paul Belanger wrote:
> Let me explain how bamboo works, this should clear up some issues.
>
> Bamboo start
> -> remote agent runs build-asterisk.sh
> --> checkout asterisk
> ---> compile / install / samples for asterisk
> ---> checkout testsuite
> ----> make addons / install asttest
> ----> runtests.py
> ----> cp xml results
> ---> uninstall asterisk
> --> generate coverage
> -> bamboo copies artifacts
> -> bamboo deletes everything
>
> At the point of 'bamboo copies artifacts' is where we look into testsuite/logs/ folder to get the information. So, we can get the symlink information, I'm actually not sure if this will work, because for whatever reason bamboo will not copy files into an artifact folder if they exist out side the sandbox instance it creates. And becuase /tmp/asterisk-testsuite exists outside of the sandbox instance, we cannot directly access this.
>
> So, copying is an issue, however for local development boxes, because we are just eating up HDD space. Like I said, I don't even know if a symlink will work.
>
I'm pretty sure symbolic links won't work, since the things that they point to would be destroyed by the 'bamboo deletes everything' step. If you have a link to something that doesn't exist, you won't be able to read the contents :-)
I think we can copy the files as bamboo doesn't actually do the file manipulation; the tests themselves do. Since the tests are already manipulating files within their own directories (by creating python log files in the .\logs\ directories) and manipulating files in the /tmp/ directories, they should have write permissions to both locations. So the test should be able to copy things between the locations prior to the runtests.py script completing.
As far as HDD space goes, that is a concern, but probably something outside of this patch. We should have an archival policy that prevents the test system machines from running out of disk space, and that's more of a systems management issue.
- mjordan
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1431/#review4305
-----------------------------------------------------------
On Sept. 12, 2011, 1:42 p.m., mjordan wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1431/
> -----------------------------------------------------------
>
> (Updated Sept. 12, 2011, 1:42 p.m.)
>
>
> Review request for Asterisk Developers and Paul Belanger.
>
>
> Summary
> -------
>
> The TestSuite will now archive the Asterisk logs if a test run fails. All logs are copied to the local ./logs directory, using the same relative test path used for the /tmp/asterisk-testsuite/ directory.
>
> Note that since the top level script does not have knowledge of the number of instances of Asterisk created by a test, all Asterisk (ast1, etc.) directories created by the test are archived.
>
>
> Diffs
> -----
>
> /asterisk/trunk/runtests.py 2190
> /asterisk/trunk/lib/python/asterisk/asterisk.py 2188
>
> Diff: https://reviewboard.asterisk.org/r/1431/diff
>
>
> Testing
> -------
>
> local machine. Induced a test failure, tested multiple runs to ensure that archiving occurs even if directories were previously copied.
>
>
> Thanks,
>
> mjordan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110913/e29d7015/attachment.htm>
More information about the asterisk-dev
mailing list