Skip to content

Commit

Permalink
add tests for pkg-config failure scenario
Browse files Browse the repository at this point in the history
due to conflicting gcc CFLAGS, details in #1772 and #1731.

added to both master and PR pipelines.
  • Loading branch information
flavorjones committed Aug 15, 2018
1 parent 254f341 commit 91a63d5
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 11 deletions.
53 changes: 53 additions & 0 deletions concourse/nokogiri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ groups:
- "ruby-<%= ruby_version %>-vendored"
- "ruby-<%= ruby_version %>-valgrind"
<% end %>
- "ruby-vanilla-system"
<% for ruby_version in RUBIES[:mri].last(1) %>
- "ruby-libxmlruby-system"
- "ruby-libxmlruby-vendored"
Expand Down Expand Up @@ -33,6 +34,7 @@ groups:
- ruby-<%= RUBIES[:mri].last %>-system-pr
- ruby-<%= RUBIES[:mri].last %>-vendored-pr
- ruby-<%= RUBIES[:mri].last %>-valgrind-pr
- ruby-vanilla-system-pr
- jruby-<%= RUBIES[:jruby].last %>-pr
- rbx-<%= RUBIES[:rbx].last %>-pr
- pr-success
Expand Down Expand Up @@ -162,6 +164,29 @@ jobs:
<% end %>

% ruby_version = RUBIES[:mri].last
- name: ruby-vanilla-system
public: true
plan:
- get: ci
- get: nokogiri
trigger: true
passed: ["ruby-<%= ruby_version %>-system"]
- task: rake-test
config:
platform: linux
image_resource:
type: docker-image
source: {repository: ubuntu, tag: xenial}
inputs:
- name: ci
- name: nokogiri
params:
NOKOGIRI_USE_SYSTEM_LIBRARIES: t
TEST_WITH_APT_REPO_RUBY: t
run:
path: ci/concourse/tasks/rake-test/run.sh
on_failure: *notify_failure_to_irc

- name: ruby-libxmlruby-system
public: true
plan:
Expand Down Expand Up @@ -433,6 +458,33 @@ jobs:
on_failure: { aggregate: [*notify_failure_to_irc, *notify_failure_to_pr] }
<% end %>

% ruby_version = RUBIES[:mri].last
- name: ruby-vanilla-system-pr
public: true
max_in_flight: 1
plan:
- get: ci
- get: nokogiri-pr
trigger: true
version: every
passed: ["ruby-<%= ruby_version %>-system-pr"]
- task: rake-test
config:
platform: linux
image_resource:
type: docker-image
source: {repository: ubuntu, tag: xenial}
inputs:
- name: ci
- name: nokogiri-pr
path: nokogiri
params:
NOKOGIRI_USE_SYSTEM_LIBRARIES: t
TEST_WITH_APT_REPO_RUBY: t
run:
path: ci/concourse/tasks/rake-test/run.sh
on_failure: { aggregate: [*notify_failure_to_irc, *notify_failure_to_pr] }

% jruby_version = RUBIES[:jruby].last
- name: jruby-<%= jruby_version %>-pr
public: true
Expand Down Expand Up @@ -501,6 +553,7 @@ jobs:
- ruby-<%= RUBIES[:mri].last %>-system-pr
- ruby-<%= RUBIES[:mri].last %>-vendored-pr
- ruby-<%= RUBIES[:mri].last %>-valgrind-pr
- ruby-vanilla-system-pr
- jruby-<%= RUBIES[:jruby].last %>-pr
- rbx-<%= RUBIES[:rbx].last %>-pr
- put: nokogiri-pr
Expand Down
27 changes: 16 additions & 11 deletions concourse/tasks/rake-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@

set -e -x -u

APT_UPDATED=false

function ensure-apt-update {
if [[ $APT_UPDATED != "false" ]] ; then
return
fi

apt-get update
APT_UPDATED=true
}

if [[ ${TEST_WITH_APT_REPO_RUBY:-} != "" ]] ; then
ensure-apt-update
apt-get install -y ruby ruby-dev bundler libxslt-dev libxml2-dev pkg-config
fi

VERSION_INFO=$(ruby -v)
RUBY_ENGINE=$(cut -d" " -f1 <<< "${VERSION_INFO}")
RUBY_VERSION=$(cut -d" " -f2 <<< "${VERSION_INFO}")

APT_UPDATED=false

FROZEN_STRING_REF="53f9b66"

function mri-24-or-greater {
Expand Down Expand Up @@ -36,15 +50,6 @@ function rbx-engine {
return 1
}

function ensure-apt-update {
if [[ $APT_UPDATED != "false" ]] ; then
return
fi

apt-get update
APT_UPDATED=true
}

pushd nokogiri

if rbx-engine ; then
Expand Down

0 comments on commit 91a63d5

Please sign in to comment.