Skip to content
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

Use new travis infrastructure for travis tests #8835

Merged
merged 54 commits into from Oct 30, 2015
Merged

Conversation

diosmosis
Copy link
Member

I got the tests to run and pass: https://travis-ci.org/piwik/piwik/jobs/81561860

They aren't much faster, but I have noticed the builds start much quicker (as in, from travis status created -> booting -> running).

TODO:

  • Fix UI tests where URL is different due to port being used.
  • Create ability for plugins to install their own packages in generated .travis.yml.
  • Make sure sudo: false is specified through command line parameter to generate so plugin builds can be converted one by one in case they need extra time.
  • Test against mariadb instead of mysql 5.6. Test against mysql 5.5 for now, switch to 5.5 + mariadb in another ticket.
  • Test that plugin builds can pass w/ & w/o --sudo-false option.
  • Document new options & YAML partials.
  • Review & merge.

List of Changes

  1. APT packages required by Piwik core in travis are added via travis' addons section. Plugins can extend this section by creating addons.apt.sources and/or addons.apt.packages files in their tests/travis directory. Doing so is only required if using the new travis infrastructure, since sudo will not be available.
  2. Added a new switch to generate:travis-yml: --sudo-false. This will generate .travis.yml w/ sudo: false, which will use travis' new infrastructure. We don't do this by default because some plugin builds will require sudo (ie, LoginLdap).
  3. Added a new DI environment, ui-test. ui-test.php DI config files will be included (along w/ test.php) during UI tests. Currently this environment is used to make sure the UI tests will pass no matter what port Piwik is hosted on (required since sudo rights are needed to listen to ports 1-1024 on linux).
  4. Added [tests] port to let Piwik know it is on a port during tests.
  5. Some bug fixes in the order in which DI configs are included in ContainerFactory.php. (User config was added before environment, should be after so it can override anything. Also, made it possible for plugins to specify dev.php DI configs.)
  6. UI tests now automatically remove PIWIK_INCLUDE_PATH from the HTML so more tests will pass locally. The root URL is also removed from UI test HTML & from system test responses (which lets ScheduledReports tests pass when the port is not 80).
  7. Make sure a symbolic link is created for the misc folder during UI tests. It's used by some tests.
  8. In travis-scripts, fixed a bug that affected plugins that used custom build steps. The YAML partials were not indented correctly, now they are.
  9. Travis builds will no longer test against MySQL 5.6. It is currently not possible to install 5.6 using travis' new infrastructure. Since we will be including tests against MariaDB soon-ish, shouldn't be too much of an issue.

Merge Strategy

Should be merged on a weekend so no one will need the build immediately.

  1. Merge Changes to travis generation command + travis scripts to use new travis infrastructure travis-scripts#14
  2. Merge this PR
  3. Get build to pass and ensure plugin builds pass.

@diosmosis diosmosis added Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. labels Sep 22, 2015
@diosmosis diosmosis self-assigned this Sep 22, 2015
@diosmosis diosmosis added this to the 2.15.0 milestone Sep 22, 2015
@mattab
Copy link
Member

mattab commented Sep 22, 2015

Nice progress, I think it will save quite a few build time minutes per day!

@mattab mattab modified the milestones: 2.15.1, 2.15.0 Oct 2, 2015
@diosmosis diosmosis force-pushed the travis_sudo_false2 branch 3 times, most recently from 0e2b8b1 to 510f063 Compare October 17, 2015 02:27
@diosmosis diosmosis added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Oct 27, 2015
@diosmosis
Copy link
Member Author

This PR is ready for review. I don't think it will be a very fun review, though.

// Overlay needs the full URLs in order to find the links in the embedded page (otherwise the %
// tooltips don't show up)
if (!empty($request['method'])
&& $request['method'] == 'Overlay.getFollowingPages'
Copy link
Member

Choose a reason for hiding this comment

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

Should this be maybe done in the overlay plugin config ui-test.php? (not sure if it is possible and whether we look for ui-test.php environment in plugins)

Copy link
Member Author

Choose a reason for hiding this comment

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

I can add a ui-test.php file to Overlay. I can't add the event there though, since we'd need to abort the event in config/ui-test.php with the event in Overlay. I could create a test class UITestResponseManipulator that is used in this global event and make it use a blacklist. Then in Overlay, the ui-test.php could just add to the blacklist. Do you think this is a good idea?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I don't really understand re aborting the event etc. If it's too much work should be fine to leave it here I reckon

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought up a simpler way of doing this, will give it a shot

@diosmosis
Copy link
Member Author

Ready for another review. If there are no problems, will merge on weekend.

@tsteur
Copy link
Member

tsteur commented Oct 29, 2015

👍 lgtm

…n the list, not running code only for those entries.
diosmosis added a commit to matomo-org/travis-scripts that referenced this pull request Oct 30, 2015
Refs matomo-org/matomo#8835, changes to travis generation command + travis scripts to use new travis infrastructure.
diosmosis added a commit that referenced this pull request Oct 30, 2015
Use new travis infrastructure for travis tests
@diosmosis diosmosis merged commit c975e0d into master Oct 30, 2015
@diosmosis diosmosis deleted the travis_sudo_false2 branch October 30, 2015 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants