7
7
import com .google .common .collect .ImmutableMap ;
8
8
import com .google .common .collect .Lists ;
9
9
import io .airbyte .config .EnvConfigs ;
10
+ import io .airbyte .config .WorkerEnvConstants ;
10
11
import io .airbyte .workers .WorkerConfigs ;
11
12
import io .airbyte .workers .WorkerException ;
12
13
import java .nio .file .Path ;
@@ -31,6 +32,10 @@ class AirbyteIntegrationLauncherTest {
31
32
"config" , "{}" ,
32
33
"catalog" , "{}" ,
33
34
"state" , "{}" );
35
+ private static final Map <String , String > JOB_METADATA = Map .of (
36
+ WorkerEnvConstants .WORKER_CONNECTOR_IMAGE , FAKE_IMAGE ,
37
+ WorkerEnvConstants .WORKER_JOB_ID , JOB_ID ,
38
+ WorkerEnvConstants .WORKER_JOB_ATTEMPT , String .valueOf (JOB_ATTEMPT ));
34
39
35
40
private WorkerConfigs workerConfigs ;
36
41
private ProcessFactory processFactory ;
@@ -48,7 +53,7 @@ void spec() throws WorkerException {
48
53
launcher .spec (JOB_ROOT );
49
54
50
55
Mockito .verify (processFactory ).create (JOB_ID , JOB_ATTEMPT , JOB_ROOT , FAKE_IMAGE , false , Collections .emptyMap (), null ,
51
- workerConfigs .getResourceRequirements (), Map .of (KubeProcessFactory .JOB_TYPE , KubeProcessFactory .SPEC_JOB ), Map . of () , Map .of (),
56
+ workerConfigs .getResourceRequirements (), Map .of (KubeProcessFactory .JOB_TYPE , KubeProcessFactory .SPEC_JOB ), JOB_METADATA , Map .of (),
52
57
"spec" );
53
58
}
54
59
@@ -59,7 +64,7 @@ void check() throws WorkerException {
59
64
Mockito .verify (processFactory ).create (JOB_ID , JOB_ATTEMPT , JOB_ROOT , FAKE_IMAGE , false , CONFIG_FILES , null ,
60
65
workerConfigs .getResourceRequirements (),
61
66
Map .of (KubeProcessFactory .JOB_TYPE , KubeProcessFactory .CHECK_JOB ),
62
- Map . of () ,
67
+ JOB_METADATA ,
63
68
Map .of (),
64
69
"check" ,
65
70
"--config" , "config" );
@@ -72,7 +77,7 @@ void discover() throws WorkerException {
72
77
Mockito .verify (processFactory ).create (JOB_ID , JOB_ATTEMPT , JOB_ROOT , FAKE_IMAGE , false , CONFIG_FILES , null ,
73
78
workerConfigs .getResourceRequirements (),
74
79
Map .of (KubeProcessFactory .JOB_TYPE , KubeProcessFactory .DISCOVER_JOB ),
75
- Map . of () ,
80
+ JOB_METADATA ,
76
81
Map .of (),
77
82
"discover" ,
78
83
"--config" , "config" );
@@ -85,7 +90,7 @@ void read() throws WorkerException {
85
90
Mockito .verify (processFactory ).create (JOB_ID , JOB_ATTEMPT , JOB_ROOT , FAKE_IMAGE , false , CONFIG_CATALOG_STATE_FILES , null ,
86
91
workerConfigs .getResourceRequirements (),
87
92
Map .of (KubeProcessFactory .JOB_TYPE , KubeProcessFactory .SYNC_JOB , KubeProcessFactory .SYNC_STEP , KubeProcessFactory .READ_STEP ),
88
- Map . of () ,
93
+ JOB_METADATA ,
89
94
Map .of (),
90
95
Lists .newArrayList (
91
96
"read" ,
@@ -101,7 +106,7 @@ void write() throws WorkerException {
101
106
Mockito .verify (processFactory ).create (JOB_ID , JOB_ATTEMPT , JOB_ROOT , FAKE_IMAGE , true , CONFIG_CATALOG_FILES , null ,
102
107
workerConfigs .getResourceRequirements (),
103
108
Map .of (KubeProcessFactory .JOB_TYPE , KubeProcessFactory .SYNC_JOB , KubeProcessFactory .SYNC_STEP , KubeProcessFactory .WRITE_STEP ),
104
- Map . of () ,
109
+ JOB_METADATA ,
105
110
Map .of (),
106
111
"write" ,
107
112
"--config" , "config" ,
0 commit comments