MCPcopy Index your code
hub / github.com/regclient/regclient / TestProcess

Function TestProcess

cmd/regsync/regsync_test.go:35–866  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33)
34
35func TestProcess(t *testing.T) {
36 t.Parallel()
37 ctx := context.Background()
38 boolT := true
39 var err error
40 tempDir := t.TempDir()
41 err = copyfs.Copy(tempDir+"/testrepo", "../../testdata/testrepo")
42 if err != nil {
43 t.Fatalf("failed to copy testrepo to tempdir: %v", err)
44 }
45 err = copyfs.Copy(tempDir+"/external", "../../testdata/external")
46 if err != nil {
47 t.Fatalf("failed to copy external to tempdir: %v", err)
48 }
49 regHandler := olareg.New(oConfig.Config{
50 Storage: oConfig.ConfigStorage{
51 StoreType: oConfig.StoreMem,
52 RootDir: "../../testdata",
53 },
54 })
55 ts := httptest.NewServer(regHandler)
56 tsURL, _ := url.Parse(ts.URL)
57 tsHost := tsURL.Host
58 regROHandler := olareg.New(oConfig.Config{
59 Storage: oConfig.ConfigStorage{
60 StoreType: oConfig.StoreMem,
61 RootDir: "../../testdata",
62 ReadOnly: &boolT,
63 },
64 })
65 tsRO := httptest.NewServer(regROHandler)
66 tsROURL, _ := url.Parse(tsRO.URL)
67 tsROHost := tsROURL.Host
68 t.Cleanup(func() {
69 ts.Close()
70 _ = regHandler.Close()
71 })
72 rcHosts := []config.Host{
73 {
74 Name: tsHost,
75 Hostname: tsHost,
76 TLS: config.TLSDisabled,
77 },
78 {
79 Name: tsROHost,
80 Hostname: tsROHost,
81 TLS: config.TLSDisabled,
82 },
83 {
84 Name: "registry.example.org",
85 Hostname: tsHost,
86 TLS: config.TLSDisabled,
87 },
88 }
89 delayInit, _ := time.ParseDuration("0.05s")
90 delayMax, _ := time.ParseDuration("0.10s")
91 // replace regclient with one configured for test hosts
92 rc := regclient.New(

Callers

nothing calls this directly

Calls 15

processMethod · 0.95
CopyFunction · 0.92
NewFunction · 0.92
WithConfigHostFunction · 0.92
WithRegOptsFunction · 0.92
WithDelayFunction · 0.92
NewFunction · 0.92
ParseFunction · 0.92
NewFunction · 0.92
GetPlatformDescFunction · 0.92
WithReferrerMatchOptFunction · 0.92
WithReferrerSourceFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…