Skip to content

Commit

Permalink
debug tester image
Browse files Browse the repository at this point in the history
  • Loading branch information
gl-johnson committed Feb 28, 2023
1 parent b59a7a9 commit 6887186
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 35 deletions.
3 changes: 3 additions & 0 deletions ci/utils
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ function announce {
}

function finish {
announce 'Dumping Conjur logs...'
docker-compose -f "$DOCKER_COMPOSE_FILE" logs --tail="all" conjur

announce 'Removing environment...'
docker-compose -f "$DOCKER_COMPOSE_FILE" down -v
}
Expand Down
11 changes: 5 additions & 6 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cloudfoundry/cflinuxfs3
FROM cloudfoundry/cflinuxfs3:0.345.0

ENV WD_PATH="/cyberark/cloudfoundry-conjur-buildpack" \
TEST_PATH="/cyberark/cloudfoundry-conjur-buildpack/tests"
Expand All @@ -10,14 +10,13 @@ RUN apt-get update && \
apt-get install -y apt-transport-https \
ca-certificates \
openssl \
ruby2.5-dev
ruby-dev

# Install the Cloud Foundry CLI
RUN wget -q https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key && \
apt-key add cli.cloudfoundry.org.key && \
echo "deb https://packages.cloudfoundry.org/debian stable main" > /etc/apt/sources.list.d/cloudfoundry-cli.list && \
RUN wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | apt-key add - && \
echo "deb https://packages.cloudfoundry.org/debian stable main" | tee /etc/apt/sources.list.d/cloudfoundry-cli.list && \
apt-get update && \
apt-get install -y cf-cli
apt-get install -y cf7-cli

# Install ruby dependencies
RUN mkdir -p "$TEST_PATH" && \
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/apps/ruby/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

ruby '~> 2.5'
ruby '~> 3.0.2'

gem 'sinatra', ">= 2.2.0"
gem 'rack', ">= 2.2.4"
Expand Down
23 changes: 0 additions & 23 deletions tests/integration/features/integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,13 @@ Feature: Integrations Tests for remote TAS foundation
Given I create an org and space
And I install the buildpack

Scenario: Python offline buildpack integration
When I push a "python" app with the "offline" buildpack
Then the secrets.yml values are available in the app

Scenario: Ruby offline buildpack integration
When I push a "ruby" app with the "offline" buildpack
Then the secrets.yml values are available in the app

Scenario: PHP offline buildpack integration
When I push a "php" app with the "offline" buildpack
Then the secrets.yml values are available in the app

Scenario: Java offline buildpack integration
When I push a "java" app with the "offline" buildpack
Then the secrets.yml values are available in the app

# # The online buildpack tests are only valid if the latest commits
# # are push to the Github remote branch.
Scenario: Python online buildpack integration
When I push a "python" app with the "online" buildpack
Then the secrets.yml values are available in the app

Scenario: Ruby online buildpack integration
When I push a "ruby" app with the "online" buildpack
Then the secrets.yml values are available in the app

Scenario: PHP online buildpack integration
When I push a "php" app with the "online" buildpack
Then the secrets.yml values are available in the app

Scenario: Java online buildpack integration
When I push a "java" app with the "online" buildpack
Then the secrets.yml values are available in the app
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@
end

When('I push a {string} app with the {string} buildpack') do |language, buildpack_type|
puts "login_to_pcf"
login_to_pcf
puts "cf_target"
cf_target(cf_ci_org, cf_ci_space)

@app_name = "#{buildpack_type}-#{language}-app"

puts "app_name: #{@app_name}"
Dir.chdir("apps/#{language}") do
puts "pwd: ", Dir.pwd()
if buildpack_type == 'online'
create_online_app_manifest
else
create_offline_app_manifest
end
ShellSession.execute("cf push #{@app_name} --random-route")
ShellSession.execute("cf logs #{@app_name} --recent")
puts "created manifest. pushing app..."
ShellSession.execute("cf push #{@app_name}")
end
end

Expand Down
8 changes: 7 additions & 1 deletion tests/integration/features/support/shell_session.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class ShellSession
def self.execute(cmd, env = nil)
puts 1
ShellSession.new.execute(cmd, env)
puts 6
end

def initialize
Expand All @@ -9,15 +11,19 @@ def initialize
end

def execute(cmd, env = nil)
puts 2
if env
puts 3
success = system(env, cmd)
else
puts 4
@commands << "$ #{cmd}"
@output << `#{cmd}`
success = $?.exitstatus.zero?
end
puts 5

puts log
# puts "Log:\n#{log}"

raise log unless success

Expand Down

0 comments on commit 6887186

Please sign in to comment.