Skip to content

Commit

Permalink
(#25) Add a test with a more complex scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Apr 16, 2020
1 parent 26eee98 commit 8096d05
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
19 changes: 19 additions & 0 deletions compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@ func TestLocalDockerCompose(t *testing.T) {
defer destroyFn()
}

func TestLocalDockerComposeComplex(t *testing.T) {
path := "./testresources/docker-compose-complex.yml"

identifier := strings.ToLower(uuid.New().String())

compose := NewLocalDockerCompose([]string{path}, identifier)

err := compose.
WithCommand([]string{"up", "-d"}).
Invoke()
checkIfError(t, err)

destroyFn := func() {
err := compose.Down()
checkIfError(t, err)
}
defer destroyFn()
}

func TestLocalDockerComposeWithEnvironment(t *testing.T) {
path := "./testresources/docker-compose-simple.yml"

Expand Down
21 changes: 21 additions & 0 deletions testresources/docker-compose-complex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'
services:
portal:
image: liferay/portal:7.2.1-ga2
depends_on:
- mysql
environment:
- LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_DRIVER_UPPERCASEC_LASS_UPPERCASEN_AME=com.mysql.cj.jdbc.Driver
- LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_PASSWORD=my-secret-pw
- LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL=jdbc:mysql://mysql/lportal?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&serverTimezone=GMT&useFastDateParsing=false&useUnicode=true
- LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_USERNAME=root
- LIFERAY_RETRY_PERIOD_JDBC_PERIOD_ON_PERIOD_STARTUP_PERIOD_MAX_PERIOD_RETRIES=5
- LIFERAY_RETRY_PERIOD_JDBC_PERIOD_ON_PERIOD_STARTUP_PERIOD_DELAY=5
ports:
- "8080:8080"
- "11311:11311"
mysql:
image: mdelapenya/mysql-utf8:5.7
environment:
- MYSQL_DATABASE=lportal
- MYSQL_ROOT_PASSWORD=my-secret-pw

0 comments on commit 8096d05

Please sign in to comment.