Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/service-waiter/cmd/database_test.go
2498 views
1
// Copyright (c) 2023 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package cmd
6
7
import (
8
_ "embed"
9
"os"
10
"strings"
11
"testing"
12
)
13
14
func TestGetLatestMigrationName(t *testing.T) {
15
t.Run("should have latest migration name", func(t *testing.T) {
16
path, err := os.Getwd()
17
if err != nil {
18
t.Errorf("failed to get current work dir: %v", err)
19
return
20
}
21
if !strings.Contains(path, "components-service-waiter--app") {
22
t.Skip("skipping test; not running in leeway build")
23
return
24
}
25
if GetLatestMigrationName() == "" {
26
t.Errorf("migration name should not be empty")
27
}
28
})
29
}
30
31