mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
* Make db waiter to wait latest migration * Move generate out of build * Remove conn require * Allow to ignore migration check * Use shell * Use fail and remote useless log * Generate service-waiter txt when create migration * Revert "Generate service-waiter txt when create migration" This reverts commit 11c12b83544a448f9784f8aa94cdfd69cfb15f45. * Add log
30 lines
713 B
Go
30 lines
713 B
Go
// Copyright (c) 2023 Gitpod GmbH. All rights reserved.
|
|
// Licensed under the GNU Affero General Public License (AGPL).
|
|
// See License.AGPL.txt in the project root for license information.
|
|
|
|
package cmd
|
|
|
|
import (
|
|
_ "embed"
|
|
"os"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestGetLatestMigrationName(t *testing.T) {
|
|
t.Run("should have latest migration name", func(t *testing.T) {
|
|
path, err := os.Getwd()
|
|
if err != nil {
|
|
t.Errorf("failed to get current work dir: %v", err)
|
|
return
|
|
}
|
|
if !strings.Contains(path, "components-service-waiter--app") {
|
|
t.Skip("skipping test; not running in leeway build")
|
|
return
|
|
}
|
|
if GetLatestMigrationName() == "" {
|
|
t.Errorf("migration name should not be empty")
|
|
}
|
|
})
|
|
}
|