(t *testing.T)
| 417 | } |
| 418 | |
| 419 | func TestParseRunURL(t *testing.T) { |
| 420 | tests := []struct { |
| 421 | name string |
| 422 | input string |
| 423 | wantRunID int64 |
| 424 | wantOwner string |
| 425 | wantRepo string |
| 426 | wantHost string |
| 427 | wantJobID int64 |
| 428 | wantStepNum int |
| 429 | wantStepLine int |
| 430 | wantErr bool |
| 431 | }{ |
| 432 | { |
| 433 | name: "Numeric run ID", |
| 434 | input: "1234567890", |
| 435 | wantRunID: 1234567890, |
| 436 | wantOwner: "", |
| 437 | wantRepo: "", |
| 438 | wantHost: "", |
| 439 | wantErr: false, |
| 440 | }, |
| 441 | { |
| 442 | name: "Run URL", |
| 443 | input: "https://github.com/owner/repo/actions/runs/12345678", |
| 444 | wantRunID: 12345678, |
| 445 | wantOwner: "owner", |
| 446 | wantRepo: "repo", |
| 447 | wantHost: "github.com", |
| 448 | wantErr: false, |
| 449 | }, |
| 450 | { |
| 451 | name: "Job URL", |
| 452 | input: "https://github.com/owner/repo/actions/runs/12345678/job/98765432", |
| 453 | wantRunID: 12345678, |
| 454 | wantOwner: "owner", |
| 455 | wantRepo: "repo", |
| 456 | wantHost: "github.com", |
| 457 | wantJobID: 98765432, |
| 458 | wantErr: false, |
| 459 | }, |
| 460 | { |
| 461 | name: "Job URL with step fragment", |
| 462 | input: "https://github.com/owner/repo/actions/runs/12345678/job/98765432#step:7:1", |
| 463 | wantRunID: 12345678, |
| 464 | wantOwner: "owner", |
| 465 | wantRepo: "repo", |
| 466 | wantHost: "github.com", |
| 467 | wantJobID: 98765432, |
| 468 | wantStepNum: 7, |
| 469 | wantStepLine: 1, |
| 470 | wantErr: false, |
| 471 | }, |
| 472 | { |
| 473 | name: "Job URL with step fragment (no line)", |
| 474 | input: "https://github.com/github/gh-aw/actions/runs/20623556740/job/59230494223#step:7", |
| 475 | wantRunID: 20623556740, |
| 476 | wantOwner: "github", |
nothing calls this directly
no test coverage detected