|
10 | 10 | run_cpl_command!("ps:restart", "-a", app)
|
11 | 11 | end
|
12 | 12 |
|
13 |
| - it "waits for all workloads to be ready", :slow do |
14 |
| - result = run_cpl_command("ps:wait", "-a", app) |
| 13 | + context "when no workloads are suspended" do |
| 14 | + it "waits for all workloads to be ready", :slow do |
| 15 | + result = run_cpl_command("ps:wait", "-a", app) |
15 | 16 |
|
16 |
| - expect(result[:status]).to eq(0) |
17 |
| - expect(result[:stderr]).to match(/Waiting for workload 'rails' to be ready[.]+? done!/) |
18 |
| - expect(result[:stderr]).to match(/Waiting for workload 'postgres' to be ready[.]+? done!/) |
| 17 | + expect(result[:status]).to eq(0) |
| 18 | + expect(result[:stderr]).to match(/Waiting for workload 'rails' to be ready[.]+? done!/) |
| 19 | + expect(result[:stderr]).to match(/Waiting for workload 'postgres' to be ready[.]+? done!/) |
| 20 | + end |
| 21 | + |
| 22 | + it "waits for specific workload to be ready", :slow do |
| 23 | + result = run_cpl_command("ps:wait", "-a", app, "--workload", "rails") |
| 24 | + |
| 25 | + expect(result[:status]).to eq(0) |
| 26 | + expect(result[:stderr]).to match(/Waiting for workload 'rails' to be ready[.]+? done!/) |
| 27 | + expect(result[:stderr]).not_to include("postgres") |
| 28 | + end |
19 | 29 | end
|
20 | 30 |
|
21 |
| - it "waits for specific workload to be ready", :slow do |
22 |
| - result = run_cpl_command("ps:wait", "-a", app, "--workload", "rails") |
| 31 | + context "when some workloads are suspended" do |
| 32 | + before do |
| 33 | + run_cpl_command!("ps:stop", "-a", app, "--workload", "rails") |
| 34 | + end |
| 35 | + |
| 36 | + it "skips suspended workloads", :slow do |
| 37 | + result = run_cpl_command("ps:wait", "-a", app) |
23 | 38 |
|
24 |
| - expect(result[:status]).to eq(0) |
25 |
| - expect(result[:stderr]).to match(/Waiting for workload 'rails' to be ready[.]+? done!/) |
26 |
| - expect(result[:stderr]).not_to include("postgres") |
| 39 | + expect(result[:status]).to eq(0) |
| 40 | + expect(result[:stderr]).to include("Workload 'rails' is suspended") |
| 41 | + expect(result[:stderr]).to match(/Waiting for workload 'postgres' to be ready[.]+? done!/) |
| 42 | + end |
27 | 43 | end
|
28 | 44 | end
|
0 commit comments