mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
This PR simplifies the `test/upgrade` tool the QA team uses to test DB upgrades. - Removes "online migration" approach because we currently don't support it (so it removes nginx as dependency). - Adds a workflow to manually run this on Github actions (in case dev/QA folks have issues with Docker on macOS, which is a common thing...) - Adds logging to the output to ease troubleshoot (previous versions was too quiet making it impossible to troubleshoot).
34 lines
745 B
Go
34 lines
745 B
Go
package upgrade
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestUpgradeAToB(t *testing.T) {
|
|
versionA := os.Getenv("FLEET_VERSION_A")
|
|
if versionA == "" {
|
|
t.Skip("Missing environment variable FLEET_VERSION_A")
|
|
}
|
|
|
|
versionB := os.Getenv("FLEET_VERSION_B")
|
|
if versionB == "" {
|
|
t.Skip("Missing environment variable FLEET_VERSION_B")
|
|
}
|
|
|
|
f := NewFleet(t, versionA)
|
|
|
|
hostname, err := enrollHost(t, f)
|
|
require.NoError(t, err)
|
|
t.Logf("first host %s enrolled successfully", hostname)
|
|
|
|
err = f.Upgrade(versionA, versionB)
|
|
require.NoError(t, err)
|
|
|
|
// enroll another host with the new version
|
|
hostname, err = enrollHost(t, f)
|
|
require.NoError(t, err)
|
|
t.Logf("second host %s enrolled successfully", hostname)
|
|
}
|