feat(workflows): introduce Artifacts BE-12919 (#2740)
This commit is contained in:
@@ -33,6 +33,9 @@ func TestStackUpdateGitWebhookUniqueness(t *testing.T) {
|
||||
err = store.Endpoint().Create(endpoint)
|
||||
require.NoError(t, err)
|
||||
|
||||
const stack1ID = portainer.StackID(456)
|
||||
const stack2ID = portainer.StackID(457)
|
||||
|
||||
src1 := &portainer.Source{
|
||||
Type: portainer.SourceTypeGit,
|
||||
GitConfig: &gittypes.RepoConfig{URL: "https://github.com/portainer/portainer.git"},
|
||||
@@ -40,7 +43,10 @@ func TestStackUpdateGitWebhookUniqueness(t *testing.T) {
|
||||
err = store.Source().Create(src1)
|
||||
require.NoError(t, err)
|
||||
|
||||
wf1 := &portainer.Workflow{SourceIDs: []portainer.SourceID{src1.ID}}
|
||||
wf1 := &portainer.Workflow{Artifacts: []portainer.ArtifactSources{{
|
||||
Artifact: portainer.Artifact{StackID: stack1ID},
|
||||
SourceIDs: []portainer.SourceID{src1.ID},
|
||||
}}}
|
||||
err = store.Workflow().Create(wf1)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -51,12 +57,15 @@ func TestStackUpdateGitWebhookUniqueness(t *testing.T) {
|
||||
err = store.Source().Create(src2)
|
||||
require.NoError(t, err)
|
||||
|
||||
wf2 := &portainer.Workflow{SourceIDs: []portainer.SourceID{src2.ID}}
|
||||
wf2 := &portainer.Workflow{Artifacts: []portainer.ArtifactSources{{
|
||||
Artifact: portainer.Artifact{StackID: stack2ID},
|
||||
SourceIDs: []portainer.SourceID{src2.ID},
|
||||
}}}
|
||||
err = store.Workflow().Create(wf2)
|
||||
require.NoError(t, err)
|
||||
|
||||
stack1 := portainer.Stack{
|
||||
ID: 456,
|
||||
ID: stack1ID,
|
||||
EndpointID: endpoint.ID,
|
||||
WorkflowID: wf1.ID,
|
||||
AutoUpdate: &portainer.AutoUpdateSettings{
|
||||
@@ -68,7 +77,7 @@ func TestStackUpdateGitWebhookUniqueness(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
stack2 := stack1
|
||||
stack2.ID++
|
||||
stack2.ID = stack2ID
|
||||
stack2.AutoUpdate = nil
|
||||
stack2.WorkflowID = wf2.ID
|
||||
|
||||
|
||||
Reference in New Issue
Block a user