1
0
mirror of synced 2026-01-06 15:03:36 -05:00
This commit is contained in:
Charles
2021-03-24 18:44:53 -07:00
committed by GitHub
parent 4065815369
commit e33b0c2188
3 changed files with 18 additions and 13 deletions

View File

@@ -62,6 +62,7 @@ class WorkspacesHandlerTest {
private StandardWorkspace workspace;
private WorkspacesHandler workspacesHandler;
@SuppressWarnings("unchecked")
@BeforeEach
void setUp() {
configRepository = mock(ConfigRepository.class);

View File

@@ -55,7 +55,6 @@ class TemporalAttemptExecutionTest {
private CheckedSupplier<Worker<String, String>, Exception> execution;
private BiConsumer<Path, String> mdcSetter;
private CheckedConsumer<Path, IOException> jobRootDirCreator;
private TemporalAttemptExecution<String, String> attemptExecution;
@@ -64,20 +63,25 @@ class TemporalAttemptExecutionTest {
void setup() throws IOException {
final Path workspaceRoot = Files.createTempDirectory(Path.of("/tmp"), "temporal_attempt_execution_test");
jobRoot = workspaceRoot.resolve(JOB_ID).resolve(String.valueOf(ATTEMPT_ID));
jobRoot = workspaceRoot.resolve(String.valueOf(JOB_ID)).resolve(String.valueOf(ATTEMPT_ID));
execution = mock(CheckedSupplier.class);
mdcSetter = mock(BiConsumer.class);
jobRootDirCreator = Files::createDirectories;
final CheckedConsumer<Path, IOException> jobRootDirCreator = Files::createDirectories;
attemptExecution = new TemporalAttemptExecution<>(workspaceRoot, JOB_RUN_CONFIG, execution, () -> "", mdcSetter, jobRootDirCreator,
attemptExecution = new TemporalAttemptExecution<>(
workspaceRoot,
JOB_RUN_CONFIG, execution,
() -> "",
mdcSetter,
jobRootDirCreator,
mock(CancellationHandler.class), () -> "workflow_id");
}
@SuppressWarnings("unchecked")
@Test
void testSuccessfulSupplierRun() throws Exception {
final String expected = "louis XVI";
Worker<String, String> worker = mock(Worker.class);
final Worker<String, String> worker = mock(Worker.class);
when(worker.run(any(), any())).thenReturn(expected);
when(execution.get()).thenAnswer((Answer<Worker<String, String>>) invocation -> worker);

View File

@@ -99,16 +99,16 @@ allprojects {
afterEvaluate { project ->
def composeDeps = [
"airbyte-config:init",
"airbyte-db",
"airbyte-migration",
"airbyte-scheduler:app",
"airbyte-server",
"airbyte-webapp",
":airbyte-config:init",
":airbyte-db",
":airbyte-migration",
":airbyte-scheduler:app",
":airbyte-server",
":airbyte-webapp",
].toSet().asImmutable()
if (project.name in composeDeps) {
composeBuild.dependsOn(project.tasks.assemble)
if (project.getPath() in composeDeps) {
composeBuild.dependsOn(project.getPath() + ':assemble')
}
}
}