|
| 1 | +Feature: Logs command |
| 2 | + As a developer |
| 3 | + I want to view logs from my application services |
| 4 | + So that I can debug and monitor my application |
| 5 | + |
| 6 | + Scenario: Shows service logs |
| 7 | + Given a procsd.yml with: |
| 8 | + """ |
| 9 | + app: myapp |
| 10 | + formation: web=1 |
| 11 | + environment: |
| 12 | + PORT: 3000 |
| 13 | + processes: |
| 14 | + web: |
| 15 | + ExecStart: ruby -e "STDOUT.sync=true; puts :ServiceStarted; sleep" |
| 16 | + """ |
| 17 | + When I run "procsd create" |
| 18 | + Then the command should succeed |
| 19 | + When I run "procsd start" |
| 20 | + Then the command should succeed |
| 21 | + When I wait 2 seconds |
| 22 | + When I run "procsd logs -n 10" |
| 23 | + Then the command should succeed |
| 24 | + And the output should match patterns: |
| 25 | + """ |
| 26 | + \d{4}-\d{2}-\d{2}T\S+ myapp-web\.1\[\d+\]: ServiceStarted |
| 27 | + """ |
| 28 | + |
| 29 | + Scenario: Shows logs for a specific service |
| 30 | + Given a procsd.yml with: |
| 31 | + """ |
| 32 | + app: myapp |
| 33 | + formation: web=1,worker=1 |
| 34 | + environment: |
| 35 | + PORT: 3000 |
| 36 | + processes: |
| 37 | + web: |
| 38 | + ExecStart: ruby -e "STDOUT.sync=true; puts :WebStarted; sleep" |
| 39 | + worker: |
| 40 | + ExecStart: ruby -e "STDOUT.sync=true; puts :WorkerStarted; sleep" |
| 41 | + """ |
| 42 | + When I run "procsd create" |
| 43 | + Then the command should succeed |
| 44 | + When I run "procsd start" |
| 45 | + Then the command should succeed |
| 46 | + When I wait 2 seconds |
| 47 | + When I run "procsd logs web -n 10" |
| 48 | + Then the command should succeed |
| 49 | + And the output should match patterns: |
| 50 | + """ |
| 51 | + \d{4}-\d{2}-\d{2}T\S+ myapp-web\.1\[\d+\]: WebStarted |
| 52 | + """ |
0 commit comments