Skip to content

Commit

Permalink
fix: skip cgroup spec
Browse files Browse the repository at this point in the history
see #7
  • Loading branch information
duncdrum committed Jan 30, 2022
1 parent 70b2b25 commit 7d6adf3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-java11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ jobs:
docker logs exist-ci | grep -w "Approximate maximum amount of memory for JVM:"
docker logs exist-ci | grep -w "Number of processors available to JVM:"
# - name: Create empty autodeploy volume
# run: |
# docker volume create autodeploy
# docker volume ls

- name: Run tests
run: bats --tap test/bats/*.bats

Expand Down
4 changes: 2 additions & 2 deletions test/bats/02-config-spec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

@test "create modified image" {
run docker create --name ex-mod -p 9090:8080 duncdrum/existdb
run docker create --name ex-mod -p 9090:8080 -v "$(pwd)"/exist/autodeploy:/exist/autodeploy duncdrum/existdb
[ "$status" -eq 0 ]
run docker cp ./conf.xml ex-mod:exist/etc/conf.xml
[ "$status" -eq 0 ]
Expand All @@ -27,7 +27,7 @@
# Make sure container is running
result=$(docker ps | grep -o 'ex-mod')
[ "$result" == 'ex-mod' ]
sleep 30
sleep 10
result=$(docker logs ex-mod | grep -o "60,000 ms during shutdown")
[ "$result" == '60,000 ms during shutdown' ]
}
Expand Down
15 changes: 10 additions & 5 deletions test/bats/05-cgroup-spec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
# These tests expect a running container at port 8080 with the name "exist-ci"
# These test will create a container "cgroup" running on port 8899

# create an empty named docker volume for use at startup -v no-auto:/exist/autodeploy
# create an empty named docker volume for use at startup -v autodeploy:/exist/autodeploy
# -v ./exist/autodeploy:/exist/autodeploy

@test "create cgroup container" {
run docker create -it -p 8899:8080 -m 1g --cpus="1.5" --name cgroup --rm duncdrum/existdb
skip
run docker create -it -p 8899:8080 -m 500m --cpus="0.5" --name cgroup --rm duncdrum/existdb
[ "$status" -eq 0 ]
run docker start cgroup
[ "$status" -eq 0 ]
}

# Tests for modifying container memory
@test "memory flag is used at startup" {
skip
result=$(docker ps | grep -o 'cgroup')
[ "$result" == 'cgroup' ]
sleep 30
Expand All @@ -32,12 +35,14 @@

# Check for cgroup config warning
@test "check logs for cgroup file warning" {
skip
result=$(docker logs cgroup | grep -ow -c 'Unable to open cgroup memory limit file' || true )
[ "$result" -eq 0 ]
}

@test "teardown cgroup container" {
run docker stop cgroup
[ "$status" -eq 0 ]
[ "$output" == "cgroup" ]
skip
run docker stop cgroup
[ "$status" -eq 0 ]
[ "$output" == "cgroup" ]
}

0 comments on commit 7d6adf3

Please sign in to comment.