MCPcopy Create free account
hub / github.com/github/gh-aw / TestGetLatestWorkflowEditTimeFromCheckout

Function TestGetLatestWorkflowEditTimeFromCheckout

pkg/cli/update_org_test.go:556–581  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

554}
555
556func TestGetLatestWorkflowEditTimeFromCheckout(t *testing.T) {
557 t.Parallel()
558
559 tempDir := t.TempDir()
560 runGit := func(args ...string) {
561 t.Helper()
562 cmd := exec.Command("git", args...)
563 cmd.Dir = tempDir
564 output, err := cmd.CombinedOutput()
565 require.NoError(t, err, "git %v failed: %s", args, string(output))
566 }
567
568 runGit("init")
569 runGit("config", "user.name", "Test User")
570 runGit("config", "user.email", "test@example.com")
571
572 workflowPath := filepath.Join(tempDir, ".github", "workflows", "example.md")
573 require.NoError(t, os.MkdirAll(filepath.Dir(workflowPath), 0o755))
574 require.NoError(t, os.WriteFile(workflowPath, []byte("---\nsource: owner/repo/.github/workflows/example.md@v1\n---\n"), 0o644))
575 runGit("add", ".")
576 runGit("commit", "-m", "add workflow")
577
578 got, err := getLatestWorkflowEditTimeFromCheckout(context.Background(), tempDir, workflowPath)
579 require.NoError(t, err)
580 assert.False(t, got.IsZero())
581}
582
583func TestBuildOrgUpdateIssue(t *testing.T) {
584 title, body := buildOrgUpdateIssue(orgRepoPreview{

Callers

nothing calls this directly

Calls 3

BackgroundMethod · 0.80
runGitFunction · 0.70

Tested by

no test coverage detected