Skip to content

Commit

Permalink
Add a test case to make sure a 'deployment' kind with the predeployed…
Browse files Browse the repository at this point in the history
… annotation is correctly deployed in phase 3
  • Loading branch information
c-gerke committed Dec 3, 2024
1 parent bfd40a7 commit c81d176
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/integration-serial/serial_deploy_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,26 @@ def test_resource_discovery_stops_deploys_when_fetch_crds_kubectl_errs
], in_order: true)
end

def test_deployment_with_predeploy_annotation_is_predeployed
# Deploy the fixtures with a modified deployment that has the predeploy annotation
result = deploy_fixtures("hello-cloud", subset: ["configmap-data.yml", "web.yml.erb"], render_erb: true) do |fixtures|
deployment = fixtures["web.yml.erb"]["Deployment"].first
deployment["metadata"]["annotations"] = {
"krane.shopify.io/predeployed" => "true"
}
end

assert_deploy_success(result)

# Verify the deployment was predeployed before other resources by checking log order
assert_logs_match_all([
"Phase 3: Predeploying priority resources",
%r{Successfully deployed in \d+.\ds: Deployment/web},
"Phase 4: Deploying all resources",
/Successfully deployed in \d+.\ds: ConfigMap\/hello-cloud-configmap-data, Deployment\/web, Ingress\/web, Service\/web/,
], in_order: true)
end

private

def rollout_conditions_annotation_key
Expand Down

0 comments on commit c81d176

Please sign in to comment.