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

Update tests output files #101

Merged
merged 1 commit into from
Aug 12, 2016
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
2 changes: 1 addition & 1 deletion script/test/cmd/globals.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

TEMP_DIR="/tmp/kompose/"
TEMP_DIR="/tmp/kompose"
TEMP_STDOUT=$TEMP_DIR/test-stdout
TEMP_STDERR=$TEMP_DIR/test-stderr
EXIT_STATUS=0
2 changes: 1 addition & 1 deletion script/test/cmd/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function convert::match_output() {

match=$(jq --argfile a $TEMP_STDOUT --argfile b $expected_output -n 'def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); ($a | (post_recurse | arrays) |= sort) as $a | ($b | (post_recurse | arrays) |= sort) as $b | $a == $b')

if ! [ $match ]; then FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; return 1;
if [ "$match" = false ]; then FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; return 1;
else SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0; fi
}
readonly -f convert::match_output
Expand Down
4 changes: 3 additions & 1 deletion script/test/cmd/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ source $KOMPOSE_ROOT/script/test/cmd/lib.sh
#######
# Tests related to docker-compose file in /script/test/fixtures/etherpad
convert::expect_failure "kompose convert --stdout -f $KOMPOSE_ROOT/script/test/fixtures/etherpad/docker-compose.yml"
convert::expect_failure "kompose convert --stdout -f $KOMPOSE_ROOT/script/test/fixtures/etherpad/docker-compose-no-image.yml"

# commenting this test case out until image handling is fixed
#convert::expect_failure "kompose convert --stdout -f $KOMPOSE_ROOT/script/test/fixtures/etherpad/docker-compose-no-image.yml"
convert::expect_warning "kompose convert --stdout -f $KOMPOSE_ROOT/script/test/fixtures/etherpad/docker-compose-no-ports.yml" "Service cannot be created because of missing port."
export $(cat $KOMPOSE_ROOT/script/test/fixtures/etherpad/envs)
# kubernetes test
Expand Down
315 changes: 161 additions & 154 deletions script/test/fixtures/etherpad/output-k8s.json
Original file line number Diff line number Diff line change
@@ -1,184 +1,191 @@
{
"kind": "Service",
"kind": "List",
"apiVersion": "v1",
"metadata": {
"name": "mariadb",
"creationTimestamp": null,
"labels": {
"service": "mariadb"
}
},
"spec": {
"ports": [
{
"name": "3306",
"protocol": "TCP",
"port": 3306,
"targetPort": 3306
}
],
"selector": {
"service": "mariadb"
}
},
"status": {
"loadBalancer": {}
}
}
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "etherpad",
"creationTimestamp": null,
"labels": {
"service": "etherpad"
}
},
"spec": {
"ports": [
{
"name": "80",
"protocol": "TCP",
"port": 80,
"targetPort": 9001
}
],
"selector": {
"service": "etherpad"
}
},
"status": {
"loadBalancer": {}
}
}
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "etherpad",
"creationTimestamp": null,
"labels": {
"service": "etherpad"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"service": "etherpad"
}
},
"template": {
"metadata": {},
"items": [
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "etherpad",
"creationTimestamp": null,
"labels": {
"service": "etherpad"
}
},
"spec": {
"containers": [
{
"name": "etherpad",
"image": "centos/etherpad",
"ports": [
{
"containerPort": 9001,
"protocol": "TCP"
}
],
"env": [
{
"name": "DB_HOST",
"value": "mariadb"
},
{
"name": "DB_PASS",
"value": "etherpad"
},
{
"name": "DB_PORT",
"value": "3306"
},
{
"name": "DB_USER",
"value": "etherpad"
},
"replicas": 1,
"selector": {
"matchLabels": {
"service": "etherpad"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"service": "etherpad"
}
},
"spec": {
"containers": [
{
"name": "DB_DBID",
"value": "etherpad"
"name": "etherpad",
"image": "centos/etherpad",
"ports": [
{
"containerPort": 9001,
"protocol": "TCP"
}
],
"env": [
{
"name": "DB_DBID",
"value": "etherpad"
},
{
"name": "DB_HOST",
"value": "mariadb"
},
{
"name": "DB_PASS",
"value": "etherpad"
},
{
"name": "DB_PORT",
"value": "3306"
},
{
"name": "DB_USER",
"value": "etherpad"
}
],
"resources": {}
}
],
"resources": {}
"restartPolicy": "Always"
}
],
"restartPolicy": "Always"
}
},
"strategy": {}
},
"status": {}
},
"strategy": {}
},
"status": {}
}
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "mariadb",
"creationTimestamp": null,
"labels": {
"service": "mariadb"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"service": "mariadb"
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "etherpad",
"creationTimestamp": null,
"labels": {
"service": "etherpad"
}
},
"spec": {
"ports": [
{
"name": "80",
"protocol": "TCP",
"port": 80,
"targetPort": 9001
}
],
"selector": {
"service": "etherpad"
}
},
"status": {
"loadBalancer": {}
}
},
"template": {
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "mariadb",
"creationTimestamp": null,
"labels": {
"service": "mariadb"
}
},
"spec": {
"containers": [
{
"name": "mariadb",
"image": "centos/mariadb",
"ports": [
{
"containerPort": 3306,
"protocol": "TCP"
}
],
"env": [
{
"name": "MYSQL_USER",
"value": "etherpad"
},
{
"name": "MYSQL_DATABASE",
"value": "etherpad"
},
{
"name": "MYSQL_PASSWORD",
"value": "etherpad"
},
"replicas": 1,
"selector": {
"matchLabels": {
"service": "mariadb"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"service": "mariadb"
}
},
"spec": {
"containers": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "etherpad"
"name": "mariadb",
"image": "centos/mariadb",
"ports": [
{
"containerPort": 3306,
"protocol": "TCP"
}
],
"env": [
{
"name": "MYSQL_USER",
"value": "etherpad"
},
{
"name": "MYSQL_DATABASE",
"value": "etherpad"
},
{
"name": "MYSQL_PASSWORD",
"value": "etherpad"
},
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "etherpad"
}
],
"resources": {}
}
],
"resources": {}
"restartPolicy": "Always"
}
},
"strategy": {}
},
"status": {}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "mariadb",
"creationTimestamp": null,
"labels": {
"service": "mariadb"
}
},
"spec": {
"ports": [
{
"name": "3306",
"protocol": "TCP",
"port": 3306,
"targetPort": 3306
}
],
"restartPolicy": "Always"
"selector": {
"service": "mariadb"
}
},
"status": {
"loadBalancer": {}
}
},
"strategy": {}
},
"status": {}
}
]
}
Loading