|
22 | 22 | # |
23 | 23 | # Options: |
24 | 24 | # --dry-run Show what would be tested without running |
| 25 | +# --workflow-dispatch-only Only run tests that use workflow_dispatch trigger |
| 26 | +# (skip issue/comment/PR-triggered tests) |
25 | 27 | # --help, -h Show help message |
26 | 28 | # |
27 | 29 | # Examples: |
28 | 30 | # ./e2e.sh # Run all tests |
29 | 31 | # ./e2e.sh --dry-run # See what would be tested |
| 32 | +# ./e2e.sh test-copilot-* --workflow-dispatch-only # Only workflow_dispatch tests |
30 | 33 | # |
31 | 34 | # Prerequisites: |
32 | 35 | # - GitHub CLI (gh) installed and authenticated |
@@ -78,6 +81,7 @@ TIMEOUT_MINUTES=10 |
78 | 81 | POLL_INTERVAL=5 |
79 | 82 | LOG_FILE="e2e-test-$(date +%Y%m%d-%H%M%S).log" |
80 | 83 | TEMP_USER_PAT_SET=false |
| 84 | +WORKFLOW_DISPATCH_ONLY=false |
81 | 85 |
|
82 | 86 | # Utility functions |
83 | 87 | log() { |
@@ -1644,6 +1648,12 @@ run_tests() { |
1644 | 1648 |
|
1645 | 1649 | # Issue-triggered and command-triggered tests - need to enable, create trigger, wait |
1646 | 1650 | *) |
| 1651 | + if [[ "$WORKFLOW_DISPATCH_ONLY" == true ]]; then |
| 1652 | + info "Skipping '$workflow' (not a workflow_dispatch test; --workflow-dispatch-only is set)" |
| 1653 | + SKIPPED_TESTS+=("$workflow") |
| 1654 | + continue |
| 1655 | + fi |
| 1656 | + |
1647 | 1657 | local workflow_file_path=".github/workflows/${workflow}.lock.yml" |
1648 | 1658 | if [[ ! -f "$workflow_file_path" ]]; then |
1649 | 1659 | error "Workflow file not found for '$workflow' at $workflow_file_path; marking as failed" |
@@ -1842,11 +1852,17 @@ main() { |
1842 | 1852 | dry_run=true |
1843 | 1853 | shift |
1844 | 1854 | ;; |
| 1855 | + --workflow-dispatch-only) |
| 1856 | + WORKFLOW_DISPATCH_ONLY=true |
| 1857 | + shift |
| 1858 | + ;; |
1845 | 1859 | --help|-h) |
1846 | 1860 | echo "Usage: $0 [OPTIONS] [TEST_PATTERNS...]" |
1847 | 1861 | echo "" |
1848 | 1862 | echo "Options:" |
1849 | 1863 | echo " --dry-run, -n Show what would be tested without running" |
| 1864 | + echo " --workflow-dispatch-only Only run tests that use workflow_dispatch trigger" |
| 1865 | + echo " (skip issue/comment/PR-triggered tests)" |
1850 | 1866 | echo " --help, -h Show this help message" |
1851 | 1867 | echo "" |
1852 | 1868 | echo "TEST_PATTERNS:" |
|
0 commit comments