|Testing in Multiple Languages (part 2)||Tyler Akins||8/23/12 6:29 AM|
In this scenario, I'm thinking my .travis.yml file should start a little like this:
script: "cd tests && php php.php"
script: "cd tests && node nodejs.js"
I'm sure that this is invalid. How would I properly set up my config so two separate builds get executed? My goal is to have a stock PHP builder do some building and a stock node.js builder do a build too. Must I resort to installing node on a PHP building machine or PHP on a node.js building machine?
|Re: Testing in Multiple Languages (part 2)||Michael Klishin||8/23/12 7:05 AM|
Use 2 environment variables, change your script: to do different
things according to that value.
You must not compile runtimes from source, that will take unreasonable
amount of time. Every VM image has one Node.js version (0.6). So use
language: php and assume `node`
will be in PATH. If this does not work, c'est la vie. We cannot jam
every single runtime in a single VM image: some of them will soon be
over 4 GB in size.
|Re: Testing in Multiple Languages (part 2)||Tyler Akins||8/24/12 6:35 AM|
On Thursday, August 23, 2012 9:05:46 AM UTC-5, Michael Klishin wrote:
On Aug 23, 5:29 pm, Tyler Akins <minimifidian...@gmail.com> wrote:> How would I properly set up my config so
Would you be able to show me the changes that you are talking about? Would this be a change to just the .travis.yml?
Oh, I did not know that the PHP machines also built things with node. I missed this page: http://about.travis-ci.org/docs/user/ci-environment/
With that in mind, would this .travis.yml file work, assuming I wrote up a good travis.sh? At least it would test against both versions of PHP and only one version of node. Is there an approved way of "apt-get install node-0.8" or something to be able to get both versions of node?
One thing I don't like about this solution is that I would run the PHP version 3 times and, if I use the proposed script that also calls node, would also run the same node 0.6 version three times. Can I just specify one PHP version in the .travis.yml file and then have my script run against all versions of PHP? Maybe make my script look like this? I'll have to return a proper error code or something - that would be added later.
Thanks for helping me work through this. I got spammed by a travis4all account on github that sent me a pull request, and I presume a pull request to over two thousand other repositories on github. The .travis.yml file in that script would not work as-is without other changes. In trying to get all of the tests to run for different versions of PHP and node to get everything tested properly.
|Re: [travis-ci] Re: Testing in Multiple Languages (part 2)||Michael Klishin||8/24/12 6:55 AM|
2012/8/24 Tyler Akins <minimif...@gmail.com>
PHP and nodejs builders do not use the same VM image but each VM image has at least one version of
Yes, this is the right way to do it.
Node.js is compiled from source, both because there are no Debian packages for all the versions we provide and because you
need a tool to switch active version before each build.
Like I said earlier, you must not compile runtimes from source before each build.
You will have to use phpenv to do PHP switching manually. At this point, I suggest that you split your project into two repositories. Travis
was not created for edge case like this one and even though we try to provide at least one version of each runtime across all VM images,
99% of projects have one primary language and maybe need runtimes like Python or JDK to run some tools or perform some setup steps.
Setting up 2 language projects is swimming against the flow.
travis4all has no affiliation with travis ci. Someone wrote a bot and it was reported to the Github support team several hours later.
It may be too painful to run everything and you only have 1 node.js version anyway. Consider only testing the PHP part or splitting
your project into 2.