(t *testing.T)
| 83 | } |
| 84 | |
| 85 | func TestCommand_Run_subDir(t *testing.T) { |
| 86 | for i := range updateStrategies { |
| 87 | strategy := updateStrategies[i] |
| 88 | t.Run(string(strategy), func(t *testing.T) { |
| 89 | // Setup the test upstream and local packages |
| 90 | g := &testutil.TestSetupManager{ |
| 91 | T: t, |
| 92 | // Update upstream to Dataset2 |
| 93 | UpstreamChanges: []testutil.Content{{Tag: "v1.2", Data: testutil.Dataset2}}, |
| 94 | GetSubDirectory: "java", |
| 95 | } |
| 96 | defer g.Clean() |
| 97 | if !g.Init(testutil.Dataset1) { |
| 98 | return |
| 99 | } |
| 100 | |
| 101 | // Update the local package |
| 102 | if !assert.NoError(t, Command{ |
| 103 | Path: "java", |
| 104 | FullPackagePath: toAbsPath(t, "java"), |
| 105 | Ref: "v1.2", |
| 106 | Strategy: strategy, |
| 107 | }.Run()) { |
| 108 | return |
| 109 | } |
| 110 | |
| 111 | // Expect the local package to have Dataset2 |
| 112 | if !g.AssertLocalDataEquals(filepath.Join(testutil.Dataset2, "java")) { |
| 113 | return |
| 114 | } |
| 115 | commit, err := g.UpstreamRepo.GetCommit() |
| 116 | if !assert.NoError(t, err) { |
| 117 | return |
| 118 | } |
| 119 | if !g.AssertKptfile(g.GetSubDirectory, commit, "v1.2") { |
| 120 | return |
| 121 | } |
| 122 | }) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | func TestCommand_Run_noChanges(t *testing.T) { |
| 127 | updates := []struct { |
nothing calls this directly
no test coverage detected