mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
ea16da813c
* [Erlang] Address apparent reproducibily issue of sample Spotted running `bin/erlang-petstore-server.sh` ond08d55d41
. Apart from newlines, this is the opposite change ofec6248cbc
. * [Erlang] Perform basic testing of sample server on CI * [Erlang] Install recent Erlang/OTP version ... in order to satisfy `jesse` compilation. The error I faced is: ``` $ curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 766k 100 766k 0 0 1041k 0 --:--:-- --:--:-- --:--:-- 1041k rebar 3.3.6 on Erlang/OTP R16B03 Erts 5.10.4 ... ===> Verifying dependencies... ===> Fetching jesse ({git,"https://github.com/for-GET/jesse.git", {tag,"1.4.0"}}) ===> Fetching jsx ({git,"https://github.com/talentdeficit/jsx.git", {branch,"v2.8.0"}}) ===> Skipping jsx (from {git,"git://github.com/talentdeficit/jsx.git", {tag,"2.8.0"}}) as an app of the same name has already been fetched ===> Compiling jsx ===> Compiling jesse ===> Compiling _build/default/lib/jesse/src/jesse_tests_util.erl failed _build/default/lib/jesse/src/jesse_tests_util.erl:28: can't find include lib "common_test/include/ct.hrl" _build/default/lib/jesse/src/jesse_tests_util.erl:55: undefined macro 'config/2' _build/default/lib/jesse/src/jesse_tests_util.erl:24: function do_test/2 undefined _build/default/lib/jesse/src/jesse_tests_util.erl:72: function test_schema/3 is unused _build/default/lib/jesse/src/jesse_tests_util.erl:102: function get_path/2 is unused _build/default/lib/jesse/src/jesse_tests_util.erl:105: function load_schema/1 is unused [ERROR] Command execution failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404) at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166) at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:804) at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:751) at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:313) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214) at org.apache.maven.cli.MavenCli.main(MavenCli.java:158) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (Erlang Test) on project ErlangServerTests: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1] ``` * [Erlang] Bump `jsx` dependency to latest stable version * [Erlang] Disable sample server from CI until compilation works
83 lines
4.4 KiB
YAML
83 lines
4.4 KiB
YAML
sudo: required
|
|
language: java
|
|
jdk:
|
|
- oraclejdk7
|
|
- oraclejdk8
|
|
|
|
cache:
|
|
directories:
|
|
- $HOME/.m2
|
|
- $HOME/.ivy2
|
|
- $HOME/.gradle/caches/
|
|
- $HOME/.gradle/wrapper/
|
|
- $HOME/samples/client/petstore/php/SwaggerClient-php/vendor
|
|
- $HOME/samples/client/petstore/ruby/venodr/bundle
|
|
- $HOME/samples/client/petstore/python/.venv/
|
|
- $HOME/samples/client/petstore/typescript-node/npm/node_modules
|
|
- $HOME/samples/client/petstore/typescript-node/npm/typings/
|
|
- $HOME/samples/client/petstore/typescript-fetch/tests/default/node_modules
|
|
- $HOME/samples/client/petstore/typescript-fetch/tests/default/typings
|
|
- $HOME/samples/client/petstore/typescript-fetch/builds/default/node_modules
|
|
- $HOME/samples/client/petstore/typescript-fetch/builds/default/typings
|
|
- $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/node_modules
|
|
- $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/typings
|
|
- $HOME/samples/client/petstore/typescript-fetch/builds/with-npm-version/node_modules
|
|
- $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings
|
|
- $HOME/samples/client/petstore/typescript-angular/node_modules
|
|
- $HOME/samples/client/petstore/typescript-angular/typings
|
|
|
|
services:
|
|
- docker
|
|
|
|
addons:
|
|
hosts:
|
|
- petstore.swagger.io
|
|
|
|
before_install:
|
|
# required when sudo: required for the Ruby petstore tests
|
|
- gem install bundler
|
|
- npm install -g typescript
|
|
- sudo pip install virtualenv
|
|
# to run petstore server locally via docker
|
|
- docker pull swaggerapi/petstore
|
|
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
|
- docker ps -a
|
|
# Add bats test framework and cURL for Bash script integration tests
|
|
- sudo add-apt-repository ppa:duggan/bats --yes
|
|
- sudo apt-get update -qq
|
|
- sudo apt-get install -qq bats
|
|
- sudo apt-get install -qq curl
|
|
# Add rebar3 build tool and recent Erlang/OTP for Erlang petstore server tests.
|
|
# - Travis CI does not support rebar3 [yet](https://github.com/travis-ci/travis-ci/issues/6506#issuecomment-275189490).
|
|
# - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18).
|
|
- . ~/otp/18.2.1/activate && erl -version
|
|
- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH"
|
|
|
|
# show host table to confirm petstore.swagger.io is mapped to localhost
|
|
- cat /etc/hosts
|
|
# show java version
|
|
- java -version
|
|
|
|
install:
|
|
# Add Godeps dependencies to GOPATH and PATH
|
|
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.4 bash)"
|
|
- export GOPATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace"
|
|
- export PATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$PATH"
|
|
|
|
script:
|
|
# fail fast
|
|
- set -e
|
|
# fail if templates/generators contain carriage return '\r'
|
|
- /bin/bash ./bin/utils/detect_carriage_return.sh
|
|
# fail if generators contain tab '\t'
|
|
- /bin/bash ./bin/utils/detect_tab_in_java_class.sh
|
|
# run integration tests defined in maven pom.xml
|
|
- mvn -q --batch-mode verify -Psamples
|
|
# docker: build generator image and push to Docker Hub
|
|
- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME; fi; fi
|
|
# docker: build cli image and push to Docker Hub
|
|
- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/swagger-codegen-cli && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME; fi; fi
|
|
|
|
env:
|
|
- DOCKER_GENERATOR_IMAGE_NAME=swaggerapi/swagger-generator DOCKER_CODEGEN_CLI_IMAGE_NAME=swaggerapi/swagger-codegen-cli
|