mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 23:39:56 +01:00
feat(be): merge task environment with template environment
This commit is contained in:
parent
4dc9106fe7
commit
fa47a24078
@ -47,10 +47,19 @@ func TestPopulateDetails(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
env, err := store.CreateEnvironment(db.Environment{
|
||||
ProjectID: proj.ID,
|
||||
JSON: `{"author": "Denis", "comment": "Hello, World!"}`,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
tpl, err := store.CreateTemplate(db.Template{
|
||||
ProjectID: proj.ID,
|
||||
RepositoryID: repo.ID,
|
||||
InventoryID: inv.ID,
|
||||
EnvironmentID: &env.ID,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
@ -62,6 +71,7 @@ func TestPopulateDetails(t *testing.T) {
|
||||
projectID: proj.ID,
|
||||
task: db.Task{
|
||||
TemplateID: tpl.ID,
|
||||
Environment: `{"comment": "Just do it!", "time": "2021-11-02"}`,
|
||||
},
|
||||
}
|
||||
|
||||
@ -69,6 +79,9 @@ func TestPopulateDetails(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if tsk.environment.JSON != `{"author":"Denis","comment":"Hello, World!","time":"2021-11-02"}` {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTaskGetPlaybookArgs(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user