Skip to content

Commit

Permalink
let Travis run the full cross-integrated test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
gyst committed Oct 15, 2012
1 parent 1335751 commit bbc7003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -6,6 +6,6 @@ before_install:
install:
- python bootstrap.py -c travis.cfg
- bin/buildout -c travis.cfg -N -q -t 3
script: bin/test
script: bin/test -s plonesocial.suite -s plonesocial.microblog -s plonesocial.activitystream -s plonesocial.network
notifications:
email: guido.stevens@cosent.net

9 comments on commit bbc7003

@hvelarde
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not working the way you are expecting; you can see Travis is just running the tests for plonesocial.suite; if you want to integrate all the tests you will have to do it in plonesocial.buildout, but we still have to figure out how to trigger Travis when a push occurs on one of the dependency packages... I'll ask @datakurre about it.

@datakurre
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hvelarde AFAIK, that's not supported by Travis-CI.

Yet, you can achieve this indirectly by using GitHub WebHooks and Service Hook API.

The downside is that this could make a GitHub API token (bound to your GitHub account with public repo read/write rights) visible for users / applications with certain rights for the repositories in question.

  1. Generate new API token with your permissios with curl -i -u USERNAME -d '{"scopes":["public_repo"]}' https://api.github.com/authorizations
  2. Find out the id of Travis-hook you'd like to trigger manually with curl -in https://api.github.com/repos/USERNAME/REPONAME/hooks?access_token=TOKEN
  3. Open Service Hooks from the admin tab of the repository that should trigger that Travis-hook and add a new WebHook URL to trigger it via GitHub's Service Hook API with curl -d -i https://api.github.com/repos/USERNAME/REPONAME/hooks/TRAVISHOOKID/test?access_token=TOKEN

This would make every commit to the repository with the described WebHook to trigger the defined Travis-hooks (usually for an another repo).

Well, this feels like a hack. Let's hope that GitHub and Travis will eventually come out with something better.

@gyst
Copy link
Member Author

@gyst gyst commented on bbc7003 Oct 15, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a Travis problem, it's a problem of the travis.cfg Plone buildout. I understand I don't have the equivalent of Jenkins multi-repo trigger support in Travis. But on each push to plonesocial.suite, I'd like to run integration tests across the full suite. However, I get ImportErrors on the other plonesocial packages even though they're on the test path. Seems to be specific for the caching directory setup in the travis.cfg. Have reproduced this locally, but haven't been able to fix it.

@datakurre
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gyst, Could you give links to the Travis builds with that issue? I guess, I'm responsble for the caching directory setup, so I should look into this :)

@datakurre
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, found the problematic Travis build.

@datakurre
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I can reproduce this locally. Weird.

@gyst
Copy link
Member Author

@gyst gyst commented on bbc7003 Oct 15, 2012 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@datakurre
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Resolved. You are not seeing the problemt locally, because of shared eggs directory outside plonesocial.suite-directory.

The problem is caused by the following line generated into bin/test

    '--test-path', '/my/workign/directory/plonesocial.suite',

That will recurse also into buildout-cache and register tests in the other packages in a wrong way.

One way to resolve that would be moving code (plonesocial directory) under src and update setup.py

diff --git a/setup.py b/setup.py
index 6acbc6e..9016472 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,8 @@ setup(
     author_email='guido.stevens@cosent.net',
     url='http://github.com/cosent/plonesocial.suite',
     license='gpl',
-    packages=find_packages(exclude=['ez_setup']),
+    packages=find_packages('src', exclude=['ez_setup']),
+    package_dir={'': 'src'},
     namespace_packages=['plonesocial'],
     include_package_data=True,
     zip_safe=False,

also, other testable eggs should be included in test-part. With collective test-buildout that could be done with

diff --git a/travis.cfg b/travis.cfg
index 2b6e42b..0c5518d 100644
--- a/travis.cfg
+++ b/travis.cfg
@@ -5,5 +5,10 @@ extends =
package-name = plonesocial.suite
package-extras = [test]

+test-eggs =
+    plonesocial.microblog[test]
+    plonesocial.activitystream[test]
+    plonesocial.network[test]
+
 [versions]
 zc.buildout = 1.6.3

After these changes, I managed to run all tests with

bin/test -s plonesocial.suite -s plonesocial.microblog -s plonesocial.activitystream -s plonesocial.network

@gyst
Copy link
Member Author

@gyst gyst commented on bbc7003 Oct 15, 2012 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.