MCPcopy Index your code
hub / github.com/bytebase/bytebase / TestGetVCSUserSkipsGitHubBot

Function TestGetVCSUserSkipsGitHubBot

action/command/vcs_user_test.go:32–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func TestGetVCSUserSkipsGitHubBot(t *testing.T) {
33 eventPath := filepath.Join(t.TempDir(), "event.json")
34 require.NoError(t, os.WriteFile(eventPath, []byte(`{"pull_request":{"user":{"id":41898282,"login":"github-actions[bot]","type":"Bot"}}}`), 0600))
35 t.Setenv("GITHUB_EVENT_NAME", "pull_request")
36 t.Setenv("GITHUB_EVENT_PATH", eventPath)
37
38 require.Nil(t, getVCSUser(world.GitHub))
39}
40
41func TestGetVCSUserFromGitHubPullRequestTarget(t *testing.T) {
42 eventPath := filepath.Join(t.TempDir(), "event.json")

Callers

nothing calls this directly

Calls 2

getVCSUserFunction · 0.85
JoinMethod · 0.80

Tested by

no test coverage detected