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

Included mysql in test suite #9

Merged
merged 8 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions TESTING_dockercompose.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?servic
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10-11" | grep "SERVICE_HOST=10.11"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10-11" | grep "LAGOON_TEST_VAR=internal-services-test"

# mysql-8-0 should be able to read/write data
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mysql?service=mysql-8-0" | grep "SERVICE_HOST=8.0"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mysql?service=mysql-8-0" | grep "LAGOON_TEST_VAR=internal-services-test"

# mysql-8-4 should be able to read/write data
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mysql?service=mysql-8-4" | grep "SERVICE_HOST=8.4"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mysql?service=mysql-8-4" | grep "LAGOON_TEST_VAR=internal-services-test"

# postgres-12 should be able to read/write data
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-12" | grep "SERVICE_HOST=PostgreSQL 12"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-12" | grep "LAGOON_TEST_VAR=internal-services-test"
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ services:
ports:
- '5432'

mysql-8-0:
image: testlagoon/mysql-8.0:pr-308
labels:
lagoon.type: mariadb
ports:
- "3306"

mysql-8-4:
image: testlagoon/mysql-8.4:pr-308 # Placeholder
labels:
lagoon.type: mariadb
ports:
- "3306"

opensearch-2:
image: uselagoon/opensearch-2:latest
environment:
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func main() {
r.HandleFunc("/mongo", mongoHandler)
r.HandleFunc("/opensearch", opensearchHandler)
r.HandleFunc("/storage", persistentStorageHandler)
r.HandleFunc("/mysql", mariadbHandler)
r.HandleFunc("/", handleReq)
http.Handle("/", r)

Expand Down Expand Up @@ -72,7 +73,7 @@ func connectorKeyValues(values []string) string {

func cleanRoute(basePath string) (string, string) {
cleanRoute := strings.ReplaceAll(basePath, "/", "")
localService := strings.ReplaceAll(cleanRoute, "10.", "10-")
localService := strings.ReplaceAll(cleanRoute, ".", "-")
replaceHyphen := strings.ReplaceAll(localService, "-", "_")
lagoonService := strings.ToUpper(replaceHyphen)
return localService, lagoonService
Expand Down