feat(master): show built-from-source services but never update them (#7)
This commit is contained in:
@@ -193,3 +193,23 @@ func TestApplySnapshot_StoresConfigFiles(t *testing.T) {
|
||||
require.Len(t, got, 1)
|
||||
assert.Equal(t, withFiles.ConfigFiles, got[0].ConfigFiles)
|
||||
}
|
||||
|
||||
func TestApplySnapshot_StoresBuilt(t *testing.T) {
|
||||
s := openTestStore(t)
|
||||
ctx := context.Background()
|
||||
id := newAgent(t, s, "node-2")
|
||||
built := slusk
|
||||
built.Built = true
|
||||
require.NoError(t, s.ApplySnapshot(ctx, id, worker, []protocol.Service{built}, t0))
|
||||
|
||||
got, err := s.ListServices(ctx)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, got, 1)
|
||||
assert.True(t, got[0].Built)
|
||||
|
||||
// A later report without the flag clears it.
|
||||
require.NoError(t, s.UpsertService(ctx, id, "", slusk, t0.Add(time.Minute)))
|
||||
got, err = s.ListServices(ctx)
|
||||
require.NoError(t, err)
|
||||
assert.False(t, got[0].Built)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user