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

Add test_alpine to circleci config #7420

Merged
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
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ defaults:
- run: echo 'export CURRENT_TAG="$CIRCLE_TAG"' >> $BASH_ENV
- run: bin/ci prepare_build
- run: bin/ci build
- run:
when: always
command: |
mkdir -p ~/test-results/spec
cp .junit/*.xml ~/test-results/spec/
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/test-results/spec

version: 2

Expand Down Expand Up @@ -62,6 +71,15 @@ jobs:
- store_artifacts:
path: ~/test-results/spec

test_alpine:
machine: true
environment:
<<: *env
TRAVIS_OS_NAME: linux
ARCH: x86_64-musl
ARCH_CMD: linux64
steps: *ci_steps

test_darwin:
macos:
xcode: "11.1.0"
Expand Down Expand Up @@ -504,6 +522,8 @@ workflows:
- /.*\bci\b.*/
- test_linux32_std:
filters: *unless_maintenance
- test_alpine:
filters: *unless_maintenance
- test_darwin:
filters: *unless_maintenance
- test_preview_mt:
Expand All @@ -528,6 +548,8 @@ workflows:
only: /.*/
- test_linux32_std:
filters: *per_tag
- test_alpine:
filters: *per_tag
- test_darwin:
filters: *per_tag
- test_preview_mt:
Expand Down Expand Up @@ -602,6 +624,7 @@ workflows:
jobs:
- test_linux
- test_linux32_std
- test_alpine
- test_darwin
- test_preview_mt
- check_format
Expand Down Expand Up @@ -660,6 +683,8 @@ workflows:
- /.*\bci\b.*/
- test_linux32_std:
filters: *maintenance
- test_alpine:
filters: *maintenance
- test_darwin:
filters: *maintenance
- test_preview_mt:
Expand Down
3 changes: 3 additions & 0 deletions bin/ci
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ with_build_env() {
x86_64)
export DOCKER_TEST_IMAGE="$DOCKER_TEST_PREFIX-build"
;;
x86_64-musl)
bcardiff marked this conversation as resolved.
Show resolved Hide resolved
export DOCKER_TEST_IMAGE="$DOCKER_TEST_PREFIX-alpine-build"
;;
i386)
export DOCKER_TEST_IMAGE="$DOCKER_TEST_PREFIX-i386-build"
;;
Expand Down
23 changes: 14 additions & 9 deletions spec/std/kernel_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,27 @@ describe "seg fault" do
error.should_not contain("Stack overflow")
end

it "detects stack overflow on the main stack" do
# This spec can take some time under FreeBSD where
# the default stack size is 0.5G. Setting a
# smaller stack size with `ulimit -s 8192`
# will address this.
status, _, error = build_and_run <<-'CODE'
{% if flag?(:musl) %}
# FIXME: Pending as mitigation for https://github.com/crystal-lang/crystal/issues/7482
pending "detects stack overflow on the main stack"
{% else %}
it "detects stack overflow on the main stack" do
# This spec can take some time under FreeBSD where
# the default stack size is 0.5G. Setting a
# smaller stack size with `ulimit -s 8192`
# will address this.
status, _, error = build_and_run <<-'CODE'
def foo
y = StaticArray(Int8,512).new(0)
foo
end
foo
CODE

status.success?.should be_false
error.should contain("Stack overflow")
end
status.success?.should be_false
error.should contain("Stack overflow")
end
{% end %}

it "detects stack overflow on a fiber stack" do
status, _, error = build_and_run <<-'CODE'
Expand Down