mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
fix conflict
Signed-off-by: Maxim Trofimov <qwerty65k@mail.ru>
This commit is contained in:
parent
b786cb40f0
commit
199784f711
1 changed files with 36 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"time"
|
||||
|
||||
sqlmock "github.com/DATA-DOG/go-sqlmock"
|
||||
migrate "github.com/rubenv/sql-migrate"
|
||||
|
||||
rspb "helm.sh/helm/v3/pkg/release"
|
||||
)
|
||||
|
|
@ -530,3 +531,38 @@ func mockGetReleaseCustomLabels(mock sqlmock.Sqlmock, key string, namespace stri
|
|||
}
|
||||
eq.WillReturnRows(returnRows).RowsWillBeClosed()
|
||||
}
|
||||
|
||||
func TestCheckAlreadyAppliedFind(t *testing.T) {
|
||||
sqlDriver, mock := newTestFixtureSQL(t)
|
||||
initID := "init"
|
||||
testMigrations := []*migrate.Migration{{Id: initID}}
|
||||
mock.
|
||||
ExpectQuery("").
|
||||
WillReturnRows(
|
||||
sqlmock.NewRows([]string{"id", "applied_at"}).
|
||||
AddRow(initID, time.Time{}))
|
||||
mock.ExpectCommit()
|
||||
|
||||
if !sqlDriver.checkAlreadyApplied(testMigrations) {
|
||||
t.Errorf("Did not find init id: %v", initID)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestCheckAlreadyAppliedNotFind(t *testing.T) {
|
||||
sqlDriver, mock := newTestFixtureSQL(t)
|
||||
initID := "init"
|
||||
testMigrations := []*migrate.Migration{{Id: initID}}
|
||||
mock.
|
||||
ExpectQuery("").
|
||||
WillReturnRows(
|
||||
sqlmock.NewRows([]string{"id", "applied_at"}).
|
||||
AddRow("1", time.Time{}).
|
||||
AddRow("2", time.Time{}))
|
||||
mock.ExpectCommit()
|
||||
|
||||
if sqlDriver.checkAlreadyApplied(testMigrations) {
|
||||
t.Errorf("Did find init id: %v, that not exists", initID)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue