Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
.idea
*.iml

# nginx package blob files extracted by nginx_service.rb NginxInstaller#prepare
# (source tarballs + packaging script downloaded from GCS blobstore)
packages/nginx/packaging
packages/nginx/*.tar.gz
packages/nginx/*.gz
packages/nginx/runtime.env
packages/nginx/.blob-fingerprint

**/*/private.yml
.blobs
.dev_builds
Expand Down
22 changes: 22 additions & 0 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ jobs:
- get: bosh-agent
- get: integration-postgres-15-image
- get: config-server
- get: release-details
- task: tests
file: bosh-ci/ci/tasks/test-rake-task.yml
image: integration-postgres-15-image
Expand All @@ -328,6 +329,10 @@ jobs:
DB: postgresql
RAKE_TASK: spec:integration
PARALLEL_TEST_MULTIPLY_PROCESSES: &parallel_test_multiplier "0.6"
- put: release-details
params:
repository: release-details
rebase: true

- name: integration-postgres-hotswap
public: true
Expand All @@ -349,6 +354,7 @@ jobs:
- get: bosh-agent
- get: integration-postgres-15-image
- get: config-server
- get: release-details
- task: tests
file: bosh-ci/ci/tasks/test-rake-task.yml
image: integration-postgres-15-image
Expand All @@ -358,6 +364,10 @@ jobs:
RAKE_TASK: spec:integration
PARALLEL_TEST_MULTIPLY_PROCESSES: *parallel_test_multiplier
UPDATE_VM_STRATEGY: create-swap-delete
- put: release-details
params:
repository: release-details
rebase: true

- name: integration-mysql
public: true
Expand All @@ -379,6 +389,7 @@ jobs:
- get: bosh-agent
- get: integration-mysql-8-0-image
- get: config-server
- get: release-details
- task: tests
file: bosh-ci/ci/tasks/test-rake-task.yml
image: integration-mysql-8-0-image
Expand All @@ -387,6 +398,10 @@ jobs:
DB: mysql
RAKE_TASK: spec:integration
PARALLEL_TEST_MULTIPLY_PROCESSES: *parallel_test_multiplier
- put: release-details
params:
repository: release-details
rebase: true

- name: candidate-release
plan:
Expand Down Expand Up @@ -1864,6 +1879,13 @@ resources:
private_key: ((github_deploy_key_bosh.private_key))
initial_version: 282.1.17

- name: release-details
type: git
source:
uri: git@github.com:cloudfoundry/bosh.git
branch: release-details
private_key: ((github_deploy_key_bosh.private_key))

- name: bosh-candidate-release-tarballs
type: gcs-resource
source:
Expand Down
20 changes: 20 additions & 0 deletions ci/tasks/test-rake-task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ if [ -d bosh-cli ] ; then
install bosh-cli/*bosh-cli-*-linux-amd64 "/usr/local/bin/bosh"
fi

if [ -d release-details ]; then
mkdir -p bosh/src/tmp
RUNTIME_LOG="release-details/parallel_spec_runtimes/integration_${DB}_${UPDATE_VM_STRATEGY:-delete-create}.log"
if [ -f "${RUNTIME_LOG}" ]; then
cp "${RUNTIME_LOG}" bosh/src/tmp/parallel_runtime_rspec.log
fi
fi

start_db "${DB}"

pushd bosh/src
Expand All @@ -226,3 +234,15 @@ pushd bosh/src

bundle exec rake --trace "${RAKE_TASK}"
popd

if [ -d release-details ]; then
if [ -f bosh/src/tmp/parallel_runtime_rspec.log ]; then
mkdir -p release-details/parallel_spec_runtimes
cp bosh/src/tmp/parallel_runtime_rspec.log "release-details/parallel_spec_runtimes/integration_${DB}_${UPDATE_VM_STRATEGY:-delete-create}.log"
cd release-details
git config user.name "CF-Bosh CI-Bot"
git config user.email "cf-bosh-ci-bot@localhost"
git add parallel_runtime_rspec_${DB}_${UPDATE_VM_STRATEGY:-delete-create}.log
git diff --staged --quiet || git commit -m "Update parallel_runtime_rspec log for ${DB} ${UPDATE_VM_STRATEGY:-delete-create}"
fi
fi
Comment thread
coderabbitai[bot] marked this conversation as resolved.
5 changes: 5 additions & 0 deletions ci/tasks/test-rake-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ inputs:
optional: true
- name: config-server
optional: true
- name: release-details
optional: true

outputs:
- name: release-details

run:
path: bosh-ci/ci/tasks/test-rake-task.sh
Expand Down
2 changes: 1 addition & 1 deletion src/spec/integration/cli_instances_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe 'cli: deployment process', type: :integration do
include IntegrationSupport::CreateReleaseOutputParsers
with_reset_sandbox_before_each
with_reset_sandbox_before_all

it 'displays instances in a deployment' do
cloud_config_hash = SharedSupport::DeploymentManifestHelper.simple_cloud_config
Expand Down
108 changes: 57 additions & 51 deletions src/spec/integration/deploy/dry_run_spec.rb
Original file line number Diff line number Diff line change
@@ -1,45 +1,63 @@
require 'spec_helper'

describe 'dry run', type: :integration do
with_reset_sandbox_before_each
context 'when no actual deployment is created' do
with_reset_sandbox_before_all

context 'when there are template errors' do
it 'prints all template evaluation errors and does not register an event' do
manifest_hash = SharedSupport::DeploymentManifestHelper.simple_manifest_with_instance_groups
manifest_hash['instance_groups'] = [
{
'name' => 'foobar',
'jobs' => ['name' => 'foobar_with_bad_properties', 'release' => 'bosh-release'],
'vm_type' => 'a',
'instances' => 1,
'networks' => [{
'name' => 'a',
}],
'stemcell' => 'default',
},
]
context 'when there are template errors' do
it 'prints all template evaluation errors and does not register an event' do
manifest_hash = SharedSupport::DeploymentManifestHelper.simple_manifest_with_instance_groups
manifest_hash['instance_groups'] = [
{
'name' => 'foobar',
'jobs' => ['name' => 'foobar_with_bad_properties', 'release' => 'bosh-release'],
'vm_type' => 'a',
'instances' => 1,
'networks' => [{
'name' => 'a',
}],
'stemcell' => 'default',
},
]

output = deploy_from_scratch(
manifest_hash: manifest_hash,
cloud_config_hash: SharedSupport::DeploymentManifestHelper.simple_cloud_config,
failure_expected: true,
dry_run: true,
)
output = deploy_from_scratch(
manifest_hash: manifest_hash,
cloud_config_hash: SharedSupport::DeploymentManifestHelper.simple_cloud_config,
failure_expected: true,
dry_run: true,
)

expect(output).to include <<~OUTPUT
Error: Unable to render instance groups for deployment. Errors are:
- Unable to render jobs for instance group 'foobar'. Errors are:
- Unable to render templates for job 'foobar_with_bad_properties'. Errors are:
- Error filling in template 'foobar_ctl' (line 8: Can't find property '["test_property"]')
- Error filling in template 'drain.erb' (line 4: Can't find property '["dynamic_drain_wait1"]')
OUTPUT
expect(output).to include <<~OUTPUT
Error: Unable to render instance groups for deployment. Errors are:
- Unable to render jobs for instance group 'foobar'. Errors are:
- Unable to render templates for job 'foobar_with_bad_properties'. Errors are:
- Error filling in template 'foobar_ctl' (line 8: Can't find property '["test_property"]')
- Error filling in template 'drain.erb' (line 4: Can't find property '["dynamic_drain_wait1"]')
OUTPUT

expect(director.vms.length).to eq(0)
expect(director.vms.length).to eq(0)
end
end

context 'when there are no errors' do
it 'returns some encouraging message but does not alter deployment' do
manifest_hash = SharedSupport::DeploymentManifestHelper.simple_manifest_with_instance_groups

deploy_from_scratch(
manifest_hash: manifest_hash,
cloud_config_hash: SharedSupport::DeploymentManifestHelper.simple_cloud_config,
dry_run: true,
)

expect(director.vms).to eq []
end
end
end

context 'when there are no errors' do
it 'returns some encouraging message but does not alter deployment' do
context 'when dry run precedes a real deployment' do
with_reset_sandbox_before_each

it 'does not interfere with a successful deployment later' do
manifest_hash = SharedSupport::DeploymentManifestHelper.simple_manifest_with_instance_groups

deploy_from_scratch(
Expand All @@ -48,25 +66,13 @@
dry_run: true,
)

expect(director.vms).to eq []
end
end

it 'does not interfere with a successful deployment later' do
manifest_hash = SharedSupport::DeploymentManifestHelper.simple_manifest_with_instance_groups

deploy_from_scratch(
manifest_hash: manifest_hash,
cloud_config_hash: SharedSupport::DeploymentManifestHelper.simple_cloud_config,
dry_run: true,
)

_, exit_code = deploy_from_scratch(
manifest_hash: manifest_hash,
cloud_config_hash: SharedSupport::DeploymentManifestHelper.simple_cloud_config,
return_exit_code: true,
)
_, exit_code = deploy_from_scratch(
manifest_hash: manifest_hash,
cloud_config_hash: SharedSupport::DeploymentManifestHelper.simple_cloud_config,
return_exit_code: true,
)

expect(exit_code).to eq(0)
expect(exit_code).to eq(0)
end
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe 'local template properties', type: :integration do
with_reset_sandbox_before_each
with_reset_sandbox_before_all
Comment thread
coderabbitai[bot] marked this conversation as resolved.

let(:manifest) do
SharedSupport::DeploymentManifestHelper.manifest_with_release.merge(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe "#146961875 When an errand's az is changed on a re-deploy", type: :integration do
with_reset_sandbox_before_each
with_reset_sandbox_before_all
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

let(:number_of_instances) { 1 }
let(:manifest) do
Expand Down
2 changes: 1 addition & 1 deletion src/spec/integration/errand/list_errands_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe 'list errands', type: :integration, with_tmp_dir: true do
with_reset_sandbox_before_each
with_reset_sandbox_before_all
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

let(:deployment_name) { manifest_hash['name'] }

Expand Down
11 changes: 4 additions & 7 deletions src/spec/integration/errand/run_errand_success_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,9 @@
end

context 'when running an errand across multiple instances' do
with_reset_sandbox_before_each
with_reset_sandbox_before_all

let(:manifest_hash) do
before(:all) do
errand_instance_spec = {
'name' => 'errand-with-same-errand-and-multiple-instances',
'jobs' => [
Expand Down Expand Up @@ -652,14 +652,11 @@
}

manifest = SharedSupport::DeploymentManifestHelper.manifest_with_errand_on_service_instance
manifest['name'] = 'errand'
manifest['instance_groups'] << errand_instance_spec
manifest['instance_groups'].first['instances'] = 4

manifest
end

before do
deploy_from_scratch(manifest_hash: manifest_hash)
deploy_from_scratch(manifest_hash: manifest)
end

it 'warns if errand is present across multiple instances' do
Expand Down
5 changes: 2 additions & 3 deletions src/spec/integration/events_access_spec.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
require 'spec_helper'

describe 'events endpoint access', type: :integration do
with_reset_sandbox_before_each(user_authentication: 'uaa')
with_reset_sandbox_before_all(user_authentication: 'uaa')

director_client_env = {'BOSH_CLIENT' => 'director-access', 'BOSH_CLIENT_SECRET' => 'secret'}
team_client_read_env = {'BOSH_CLIENT' => 'team-client-read-access', 'BOSH_CLIENT_SECRET' => 'team-secret'}
team_client_admin_env = {'BOSH_CLIENT' => 'team-client', 'BOSH_CLIENT_SECRET' => 'team-secret'}
no_access_client_env = {'BOSH_CLIENT' => 'no-access', 'BOSH_CLIENT_SECRET' => 'secret'}

before do

before(:all) do
deployment_hash = SharedSupport::DeploymentManifestHelper.simple_manifest_with_instance_groups
deployment_hash['instance_groups'][0]['instances'] = 1

Expand Down
2 changes: 1 addition & 1 deletion src/spec/integration/links/link_parse_validation_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe 'Links', type: :integration do
with_reset_sandbox_before_each
with_reset_sandbox_before_all

let(:cloud_config) do
cloud_config_hash = SharedSupport::DeploymentManifestHelper.simple_cloud_config
Expand Down
2 changes: 1 addition & 1 deletion src/spec/integration/links/network_resolution_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe 'network resolution', type: :integration do
with_reset_sandbox_before_each
with_reset_sandbox_before_all

def should_contain_network_for_job(job, template, pattern)
my_api_instance = director.instance(job, '0', deployment_name: 'simple')
Expand Down
2 changes: 1 addition & 1 deletion src/spec/integration/template_evaluation_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe 'template', type: :integration do
with_reset_sandbox_before_each
with_reset_sandbox_before_all
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

it 'can access exposed attributes of an instance' do
manifest_hash = SharedSupport::DeploymentManifestHelper.simple_manifest_with_instance_groups
Expand Down
Loading
Loading