Skip to content

Commit

Permalink
ci: check default config
Browse files Browse the repository at this point in the history
  • Loading branch information
duncdrum committed Jan 30, 2022
1 parent ca98b7d commit 70b2b25
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-java11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ jobs:
docker run -dit -p 8080:8080 --name exist-ci --rm ${{ env.TEST_TAG }}
sleep 35s
- name: Check mem and cgroup config
run: |
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: Run tests
run: bats --tap test/bats/*.bats

Expand Down
12 changes: 7 additions & 5 deletions test/bats/05-cgroup-spec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,24 @@
[ "$status" -eq 0 ]
run docker start cgroup
[ "$status" -eq 0 ]
sleep 30
}

# Tests for modifying container memory
@test "memory flag is used at startup" {
result=$(docker logs cgroup | grep -o -m 1 "Approximate maximum amount of memory for JVM: 1 GB")
[ "$result" == 'Approximate maximum amount of memory for JVM: 1 GB' ]
result=$(docker ps | grep -o 'cgroup')
[ "$result" == 'cgroup' ]
sleep 30
result=$(docker logs cgroup | grep -o -m 1 "Approximate maximum amount of memory for JVM:")
[ "$result" == 'Approximate maximum amount of memory for JVM:' ]
}

# Tests for modifying container cpu shares
# Seems bugged, and use the value defined via daemon preferences instead
@test "cpu shares are used at startup" {
skip
result=$(docker logs cgroup | grep "Number of processors available to JVM: " | tail -c 4)
result=$(docker logs cgroup | grep "Number of processors available to JVM:" | tail -c 4)
[ "$status" -eq 0 ]
["$result" == '1.5' ]
# ["$result" == '1.5' ]
}

# Check for cgroup config warning
Expand Down

0 comments on commit 70b2b25

Please sign in to comment.