Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Commit

Permalink
Merge pull request #537 from cloudfoundry/develop
Browse files Browse the repository at this point in the history
merge develop to master
  • Loading branch information
cdlliuy authored Dec 4, 2019
2 parents a4be98e + bc8e77c commit 7fdf7d1
Show file tree
Hide file tree
Showing 76 changed files with 4,719 additions and 525 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,6 @@
[submodule "src/github.com/patrickmn/go-cache"]
path = src/github.com/patrickmn/go-cache
url = https://github.com/patrickmn/go-cache
[submodule "src/github.com/juju/ratelimit"]
path = src/github.com/juju/ratelimit
url = https://github.com/juju/ratelimit
103 changes: 64 additions & 39 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@


dist: trusty
sudo: required
os: linux
dist: xenial

env:
global:
- DBURL=postgres://postgres@localhost/autoscaler?sslmode=disable
- NODE_VERSION=6.2
- GO_VERSION=1.11
- GO_VERSION=1.13.3
- LOGLEVEL=info
language: java
cache:
directories:
- $HOME/.m2
jdk:
- openjdk8
- openjdk8
services:
- postgresql
addons:
Expand All @@ -21,7 +22,7 @@ before_install:
install:
- mvn package
- npm install npm@latest -g
- nvm install $NODE_VERSION
- nvm install $NODE_VERSION --silent
- eval "$(gimme $GO_VERSION)"
- go install github.com/onsi/ginkgo/ginkgo

Expand All @@ -36,37 +37,61 @@ before_script:
- java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:postgresql://127.0.0.1/autoscaler --driver=org.postgresql.Driver --changeLogFile=src/autoscaler/eventgenerator/db/dataaggregator.db.changelog.yml update
- java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:postgresql://127.0.0.1/autoscaler --driver=org.postgresql.Driver --changeLogFile=src/autoscaler/scalingengine/db/scalingengine.db.changelog.yml update
- java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:postgresql://127.0.0.1/autoscaler --driver=org.postgresql.Driver --changeLogFile=src/autoscaler/operator/db/operator.db.changelog.yml update

matrix:
- wget https://repo.mysql.com//mysql-apt-config_0.8.14-1_all.deb
- sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb
- sudo apt-get update -q
- sudo apt-get install -q -y --allow-unauthenticated -o Dpkg::Options::=--force-confnew mysql-server
- sudo systemctl restart mysql
- sudo mysql_upgrade
- mysql --version
- mysql -u root -e "CREATE DATABASE autoscaler;"
- java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:mysql://127.0.0.1/autoscaler --driver=com.mysql.cj.jdbc.Driver --changeLogFile=api/db/api.db.changelog.yml --username=root update
- java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:mysql://127.0.0.1/autoscaler --driver=com.mysql.cj.jdbc.Driver --changeLogFile=scheduler/db/scheduler.changelog-master.yaml --username=root update
- java -cp 'db/target/lib/*' liquibase.integration.commandline.Main --url jdbc:mysql://127.0.0.1/autoscaler --driver=com.mysql.cj.jdbc.Driver --changeLogFile=scheduler/db/quartz.changelog-master.yaml --username=root update
jobs:
include:
- name: unit test
script:
# Unit test
- pushd api
- npm install
- npm test
- popd
- pushd servicebroker
- npm install
- npm test
- popd
- pushd src/autoscaler
- ginkgo -r -race -randomizeAllSpecs
- popd
- pushd scheduler
- mvn test
- popd
- name: unit test
script:
# Unit test
- pushd src/autoscaler
- ginkgo -r -race -randomizeAllSpecs
- popd
- pushd scheduler
- mvn test
- mvn test -Dspring.profiles.active=mysql

- name: integration test
script:
# Integration test
- pushd scheduler
- mvn package -DskipTests
- popd
- ginkgo -r -race -randomizeAllSpecs src/integration

# Tests for legacy components (node apiserver, broker and metricscollector)
# - name: legacy unit test
# script:
# - pushd api
# - npm install
# - npm test
# - popd
# - pushd servicebroker
# - npm install
# - npm test
# - popd

# - name: legacy integration test
# script:
# - pushd api
# - npm install
# - npm test
# - popd
# - pushd servicebroker
# - npm install
# - npm test
# - popd
# - pushd scheduler
# - mvn package -DskipTests
# - popd
# - ginkgo -r -race -randomizeAllSpecs src/integration_legacy

- name: integration test
script:
# Integration test
- pushd api
- npm install
- popd
- pushd servicebroker
- npm install
- popd
- pushd scheduler
- mvn package -DskipTests
- popd
- ginkgo -r -race -randomizeAllSpecs src/integration
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@ rm $TMPDIR/consul-0.7.5.zip
### Unit tests

```shell
pushd api
npm install
npm test
popd

pushd servicebroker
npm install
npm test
popd

go install github.com/onsi/ginkgo/ginkgo
export DBURL=postgres://postgres@localhost/autoscaler?sslmode=disable
pushd src/autoscaler
Expand All @@ -107,14 +97,6 @@ popd
### Integration tests

```shell
pushd api
npm install
popd

pushd servicebroker
npm install
popd

pushd scheduler
mvn package -DskipTests
popd
Expand Down
4 changes: 4 additions & 0 deletions api/db/api.db.changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ databaseChangeLog:
name: policy_json.type
value: text
dbms: h2
- property:
name: policy_json.type
value: json
dbms: mysql
- changeSet:
id: 1
author: pradyutsarma
Expand Down
5 changes: 5 additions & 0 deletions db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.18</version>
</dependency>
</dependencies>

<build>
Expand Down
Loading

0 comments on commit 7fdf7d1

Please sign in to comment.