juju-solutions / layer-cwr

Layer for building the Juju Jenkins CI env
Other
2 stars 5 forks source link

Bundletester couldn't find the charm directory #119

Open seman opened 7 years ago

seman commented 7 years ago

CWR-CI generating the following error once the tests start to run:

Full log: http://pastebin.ubuntu.com/24219652/

...
+ env MATRIX_MODEL_PREFIX=job-2-matrix MATRIX_OUTPUT_DIR=/srv/artifacts/cwr_charm_commit_mysql_in_cs_wiki_simple/2 cwr -F -l DEBUG -v cwr-ctnrl:job-2-valued-newt totest.yaml --bucket juju-qa-data --results-dir results --s3-creds /root/configuration/cwr_charm_commit_mysql_in_cs_wiki_simple.s3cfg --test-id 2
2017-03-21 02:03:24 INFO Running test on AWS.
2017-03-21 02:03:24 DEBUG Cache dir /root/.local/share/juju/.deployer-store-cache/cs_trusty_mediawiki-5
2017-03-21 02:03:24 DEBUG Retrieving store charm cs:trusty/mediawiki-5
2017-03-21 02:03:26 ERROR Exception (cwr-ctnrl:job-2-valued-newt):
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/cloudweatherreport/run.py", line 161, in run_plan
    test_result = self.run_tests(test_plan, env)
  File "/usr/local/lib/python2.7/dist-packages/cloudweatherreport/run.py", line 232, in run_tests
    status = tester.main(self.args)
  File "/usr/local/lib/python2.7/dist-packages/bundletester/tester.py", line 137, in main
    suite = spec.SuiteFactory(options, options.testdir)
  File "/usr/local/lib/python2.7/dist-packages/bundletester/spec.py", line 383, in SuiteFactory
    suite.find_suite()
  File "/usr/local/lib/python2.7/dist-packages/bundletester/spec.py", line 231, in find_suite
    model = models.Charm.from_deployer_charm(charm)
  File "/usr/local/lib/python2.7/dist-packages/bundletester/models.py", line 38, in from_deployer_charm
    shutil.copytree(dcharm.path, charm_dir, symlinks=True)
  File "/usr/lib/python2.7/shutil.py", line 171, in copytree
    names = os.listdir(src)
OSError: [Errno 2] No such file or directory: '/tmp/builds/mysql'
kwmonroe commented 7 years ago

I can't repo this using cwr-72 and the following invocation:

$ juju run-action cwr/0 cwr-charm-release repo=https://github.com/marcoceppi/charm-mysql charm-name=mysql reference-bundle=cs:bundle/wiki-simple

@seman are you possibly using an older cwr charm rev or some other action invocation?

Fwiw, i did not get this to run cleanly, but it did progress much farther than the /tmp/builds/mysql error reported here. Here's my run:

http://juju.does-it.net:5000/cwr_charm_release_mysql_in_cs_bundle_wiki_simple/1/report.html

johnsca commented 7 years ago

@kwmonroe: @seman's log indicates he used cwr-charm-commit while you used cwr-charm-release, though I don't see why that would make any difference to this error.

I have personally seen this error when the series is not explicitly specified and the build process ends up building into /tmp/trusty/foo while the charm thinks it should be in /tmp/builds/foo. For that case, though, I would have expected @kwmonroe's invocation to fail.

At one point, I started trying to improve the series auto-detection logic to handle this so that we wouldn't ever have to specify the series manually, but I got tripped up by the fact that the bundle isn't fetched until the tests are already invoked and then I gave up. It might be worth revisiting, though.