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

Support settings multiple languges in one travis ci file #4090

Closed
paladox opened this issue Jun 15, 2015 · 24 comments
Closed

Support settings multiple languges in one travis ci file #4090

paladox opened this issue Jun 15, 2015 · 24 comments
Labels
feature-request locked This thread is locked, and won't automatically be closed

Comments

@paladox
Copy link

paladox commented Jun 15, 2015

Hi please support setting multiple languges in one travis ci file please.

for example like

language: php, ruby, java, js

or

language: php ruby java js

@joshk
Copy link
Contributor

joshk commented Jun 15, 2015

Thanks for the issue.

Can you please explain the use case and how the install steps might work?

@paladox
Copy link
Author

paladox commented Jun 15, 2015

Use can be if you have one project that has mutple files for different programming langugages like for example having php and js then you want to be able to test both js and php not just one or the other.

It could go like for example

language: php, js

or can go like

language: php js

@joshk
Copy link
Contributor

joshk commented Jun 15, 2015

Do you have an open source which is a good example of this?

@paladox
Copy link
Author

paladox commented Jun 15, 2015

I haven't got an open source for this since it woulden work.

@BanzaiMan
Copy link
Contributor

@paladox Is there a repo that you would like to use this sort of behavior on, or is it just an idea?

@tecoholic
Copy link

I have a project which uses Python flask for backend and AngularJS for frontend. I have tests for both the language files. I currently have set up npm to run JS tests. Now I would like to add Python nosetests as well. I think this should be a good example. project is at https://github.com/GluuFederation/gluu-webui

@BanzaiMan
Copy link
Contributor

@tecoholic I suggest using language: python in that case, as you have access to both Python and Node.js runtime (via nvm).

@tecoholic
Copy link

@BanzaiMan Thanks for the tip. I never knew you could straight away call nvm. Saw some places where people have installed nodejs from scratch. nvm was simple.

@vielmetti
Copy link

I'm working on a project that depends on both python and go, though it's mostly written in go, but has some vendor dependencies that are in python that need to be tested and installed with pip. I'd also like to test on linux and osx, and if all of that works, then I'd like to iterate through various versions of python, go, and the vendor dependency.

Needless to say this looks like a messy matrix, and any suggestions or examples would be welcomed.

@come-maiz
Copy link

I want to upstream my go version of the subunit library ( https://github.com/elopio/go-subunit ). I have in that project a travis file that runs the go tests.
They already have a travis that runs the python tests ( https://github.com/testing-cabal/subunit ).
So, I have no idea how to combine the two travis files. It would be great to have support for two language tags. I will put my library in a subfolder of the upstream project, so it would also be cool if I could just move my .travis.yml file to the subfolder and the system could find it and run the tests.

@rw
Copy link

rw commented Oct 30, 2015

The FlatBuffers project (https://github.com/google/flatbuffers) uses many languages. The compiler is built in C++, and we have runtime code for the following languages: C++, C#, Go, Java, Javascript, and Python.

Has there been any progress on this issue?

@kkaefer
Copy link

kkaefer commented Dec 2, 2015

We are also having the same issue with https://github.com/mapbox/mapbox-gl-native. Our project is fundamentally implemented in C++, but we are building and testing on a variety of platforms, including Android, plain Linux, Node.js bindings etc. We've selected "Android" as the base image, since it contains the Android NDK; but selecting that affects other parts of the system, like caching (only one global cache, which doesn't help us much since our build artifacts are vastly varying).

@evilaliv3
Copy link

👍

GlobaLeaks is an other example of this.

GlobaLeaks is a framework composed by a python web backend that servers a javascript client

The language used on travis for what relates to the testing is should so be python(2.7) and node_js (4.2); thos are the two main requirements imposed by the testing frameworks.

The missing possibility for specifying multiple languages and their respective version is causing that we need to use python(2.7) in the language directive and then install node.js with sudo that makes not possible to use the new container.

@igormukhingmailcom
Copy link

+1
Another example:
Ansible role (needs python to install ansible via pip) that installs some php project using composer and depending from doctrine 2.5. As far as doctrine 2.5 depending from php 5.4 but travis by default have php 5.3 - build fails all the time: https://travis-ci.org/ansible-roles/ansible-role-symfony2/builds/98852800

So we need ability to specify both python 2.7 to install ansible and php 5.4 to install doctrine 2.5 via composer.

Playing around this and trying to solve problem hadn't succeeded...

@externl
Copy link

externl commented Feb 12, 2016

Same here, building and testing Ice requires C++, Python, Java, Ruby, PHP, and Node.js. Would be great if we could specify various versions of each language.

I tried to do this manually using the various version managers (nvm, phpenv, etc.) but they're not all available at the same time.

@kengz
Copy link

kengz commented Feb 16, 2016

Tinkered a bit and worked out the below solution using the Travis Ubuntu 14.04 Trusty beta and sudo. Putting it out there if anyone needs it.

This pretty much let you setup a VM where you can install anything; I have node_js and python3, pip3, which are not available on the default container-based VMs.

sudo: required
dist: trusty
language: node_js
node_js:
  - "5.5"
  - "4.2"
python:
  - "3.4"
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      # nodejs >v4 compiler requirements
      - g++-4.8
      - openjdk-7-jdk
before_install:
  - sudo apt-get -y install python3-pip python-dev
  - sudo pip3 install -U setuptools
  - sudo pip3 install -U virtualenvwrapper
  - python3 -V
  - pip3 -V
  # install Neo4j locally:
  - wget dist.neo4j.org/neo4j-community-2.3.2-unix.tar.gz
  - tar -xzf neo4j-community-2.3.2-unix.tar.gz
  - sed -i.bak s/dbms.security.auth_enabled=true/dbms.security.auth_enabled=false/g neo4j-community-2.3.2/conf/neo4j-server.properties
  - neo4j-community-2.3.2/bin/neo4j start
install:
  - npm install
  - sudo pip3 install -r requirements.txt
env:
  global:
    - CXX=g++-4.8
    - NODE_ENV=development

@BanzaiMan
Copy link
Contributor

BanzaiMan commented Feb 16, 2016

The directive language: X does 2 things which have far reaching effects.

  1. It specifies how build script is compiled from the data in .travis.yml. Specifying multiple languages does not make sense here.
  2. It chooses the build image that the jobs will use. Historically speaking, having a large build image had a tremendous effect on VM's boot time (a few minutes for a large image that has every thing, vs a few seconds for a language-specific image). This is an issue with builds that want to use multiple languages.

On the new infrastructure running Trusty builds, the boot time issue is much less of a concern, so we have one build image that has everything (the "mega" image mentioned in https://docs.travis-ci.com/user/trusty-ci-environment#Image-differences-from-Precise).

If you need multiple language runtimes, Trusty is currently the best bet. This may change in the future, but I don't know when that future comes.

@ghost
Copy link

ghost commented Mar 7, 2016

@BanzaiMan Could I use docker containers to have multiple languages and avoid some of the boot time issue?

@cheelee
Copy link

cheelee commented Mar 12, 2016

This feature is starting to look like something we'd use at https://github.com/openworm/tracker-commons where we intend to support multiple languages (e.g. Scala, Julia, octave, python) for a common access API template to a standard JSON format for worm movement data.

Meanwhile, I'll be taking a look at the Trusty option as a workaround.

@aviau
Copy link

aviau commented May 6, 2016

Same issue here. Python backend and js frontend. Would like to run javascript tests.

@nwalters512
Copy link

The Blue Alliance uses a Python backend and is moving to a JS-powered client. It would be great to be able to easily run both sets of unit tests on Travis.

@jayvdb
Copy link

jayvdb commented May 8, 2016

Can someone please fix the spelling mistake in the issue title... ;-) ping @paladox

@BanzaiMan BanzaiMan changed the title Support settings mutple languges in one travis ci file Support settings multiple languges in one travis ci file May 8, 2016
@travis-ci travis-ci locked and limited conversation to collaborators May 8, 2016
@BanzaiMan
Copy link
Contributor

It is unlikely that this is going to change in the near future. We will update this ticket when we have news to share.

@DrTorte DrTorte added the locked This thread is locked, and won't automatically be closed label Apr 2, 2018
@DrTorte DrTorte closed this as completed Sep 19, 2018
@DrTorte
Copy link
Contributor

DrTorte commented Sep 19, 2018

Hey everyone!

As of right now, we don't have any specific plans to implement this. For those that need this functionality there are some examples of workarounds (thanks everyone!) and the [generic image] (https://docs.travis-ci.com/user/languages/minimal-and-generic/#generic) provides a good springboard for several languages.

If we do end up doing something like this we'll be sharing such news and I'll see if I can find out if there's anything in the roadmap with similar functionality. Thanks everyone for your feedback!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request locked This thread is locked, and won't automatically be closed
Projects
None yet
Development

No branches or pull requests