Skip to content

Commit b59e883

Browse files
committed
Fixing syntax errors
1 parent bc773c1 commit b59e883

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

testing/integration/upgrade_fleet_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func testFleetManagedUpgrade(t *testing.T, info *define.Info, unprivileged bool,
110110

111111
// Start at the build version as we want to test the retry
112112
// logic that is in the build.
113-
var startFixture *testing.Fixture
113+
var startFixture *atesting.Fixture
114114
var err error
115115
if fips {
116116
startFixture, err = define.NewFixtureFromLocalFIPSBuild(t, define.Version())
@@ -521,10 +521,9 @@ func testUpgradeFleetManagedElasticAgent(
521521
err = upgradetest.CheckHealthyAndVersion(ctx, startFixture, endVersionInfo.Binary)
522522
assert.NoError(t, err)
523523

524-
if upgradeOpts.postWatcherSuccessHook != nil {
525-
if err := upgradeOpts.postWatcherSuccessHook(ctx, endFixture); err != nil {
526-
return fmt.Errorf("post watcher success hook failed: %w", err)
527-
}
524+
if upgradeOpts.PostWatcherSuccessHook != nil {
525+
err = upgradeOpts.PostWatcherSuccessHook(ctx, endFixture)
526+
require.NoError(t, err)
528527
}
529528
}
530529

testing/integration/upgrade_standalone_fips_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ func TestStandaloneUpgradeFIPStoFIPS(t *testing.T) {
8181
}
8282
t.Run(fmt.Sprintf("Upgrade %s to %s (privileged)", startVersion, define.Version()), func(t *testing.T) {
8383
upgradeOpts = append(upgradeOpts, upgradetest.WithUnprivileged(false))
84-
testStandaloneUpgradeSucceeded(t, startVersion, define.Version(), fipsArtifactFetcher, upgradeOpts...)
84+
testStandaloneUpgrade(t, startVersion, define.Version(), fipsArtifactFetcher, upgradeOpts...)
8585
})
8686
if unprivilegedAvailable {
8787
upgradeOpts = append(upgradeOpts, upgradetest.WithUnprivileged(true))
8888
t.Run(fmt.Sprintf("Upgrade %s to %s (unprivileged)", startVersion, define.Version()), func(t *testing.T) {
89-
testStandaloneUpgradeSucceeded(t, startVersion, define.Version(), fipsArtifactFetcher, upgradeOpts...)
89+
testStandaloneUpgrade(t, startVersion, define.Version(), fipsArtifactFetcher, upgradeOpts...)
9090
})
9191
}
9292
}

testing/integration/upgrade_standalone_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ func TestStandaloneUpgrade(t *testing.T) {
4040
unprivilegedAvailable = true
4141
}
4242
t.Run(fmt.Sprintf("Upgrade %s to %s (privileged)", startVersion, define.Version()), func(t *testing.T) {
43-
testStandaloneUpgradeSucceeded(t, startVersion, define.Version(), atesting.ArtifactFetcher(), upgradetest.WithUnprivileged(false))
43+
testStandaloneUpgrade(t, startVersion, define.Version(), atesting.ArtifactFetcher(), upgradetest.WithUnprivileged(false))
4444
})
4545
if unprivilegedAvailable {
4646
t.Run(fmt.Sprintf("Upgrade %s to %s (unprivileged)", startVersion, define.Version()), func(t *testing.T) {
47-
testStandaloneUpgradeSucceeded(t, startVersion, define.Version(), atesting.ArtifactFetcher(), upgradetest.WithUnprivileged(true))
47+
testStandaloneUpgrade(t, startVersion, define.Version(), atesting.ArtifactFetcher(), upgradetest.WithUnprivileged(true))
4848
})
4949
}
5050
}

testing/upgradetest/upgrader.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type UpgradeOpts struct {
5555
postInstallHook func() error
5656
preUpgradeHook func() error
5757
postUpgradeHook func() error
58-
postWatcherSuccessHook func(context.Context, *atesting.Fixture) error
58+
PostWatcherSuccessHook func(context.Context, *atesting.Fixture) error
5959
}
6060

6161
type UpgradeOpt func(opts *UpgradeOpts)
@@ -130,7 +130,7 @@ func WithPostUpgradeHook(hook func() error) UpgradeOpt {
130130
// and the upgrade watcher has terminated as well.
131131
func WithPostWatcherSuccessHook(hook func(context.Context, *atesting.Fixture) error) UpgradeOpt {
132132
return func(opts *UpgradeOpts) {
133-
opts.postWatcherSuccessHook = hook
133+
opts.PostWatcherSuccessHook = hook
134134
}
135135
}
136136

@@ -444,8 +444,8 @@ func PerformUpgrade(
444444
}
445445
}
446446

447-
if upgradeOpts.postWatcherSuccessHook != nil {
448-
if err := upgradeOpts.postWatcherSuccessHook(ctx, endFixture); err != nil {
447+
if upgradeOpts.PostWatcherSuccessHook != nil {
448+
if err := upgradeOpts.PostWatcherSuccessHook(ctx, endFixture); err != nil {
449449
return fmt.Errorf("post watcher success hook failed: %w", err)
450450
}
451451
}

0 commit comments

Comments
 (0)