Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Build Validation

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'microsoft'
- name: Build with Gradle
uses: gradle/gradle-build-action@bc3340afc5e3cc44f2321809ac090d731c13c514
with:
arguments: build
# TODO: Move the sidecar into a central image repository
- name: Initialize Durable Task Sidecar
run: docker run --name durabletask-sidecar -p 4001:4001 --env 'DURABLETASK_SIDECAR_LOGLEVEL=Debug' -d cgillum/durabletask-sidecar:latest start --backend Emulator
- name: Integration Tests with Gradle
uses: gradle/gradle-build-action@bc3340afc5e3cc44f2321809ac090d731c13c514
with:
arguments: integrationTest
- name: Archive test report
uses: actions/upload-artifact@v2
with:
name: Integration test report
path: sdk/build/reports/tests/integrationTest
- name: Upload JAR output
uses: actions/upload-artifact@v2
with:
name: Package
path: sdk/build/libs
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Java SDK for the Durable Task Framework

[![Build](https://github.com/microsoft/durabletask-java/actions/workflows/build-validation.yml/badge.svg)](https://github.com/microsoft/durabletask-java/actions/workflows/build-validation.yml)

This repo contains the Java SDK for the Durable Task Framework.

⚠ This README is currently under construction ⚠
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.
25 changes: 20 additions & 5 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "java"
id 'java'
id 'com.google.protobuf' version '0.8.16'
// Generate IntelliJ IDEA's .idea & .iml project files
id 'idea'
Expand Down Expand Up @@ -55,8 +55,23 @@ sourceSets {
}

test {
useJUnitPlatform()
useJUnitPlatform {
// Skip tests tagged as "integration" since those are slower
// and require external dependencies.
excludeTags "integration"
}
}

// Unlike normal unit tests, some tests are considered "integration tests" and shouldn't be
// run during a build. We instead tag them as "integration" tests and only run them as part
// of this custom integrationTest task. Normal builds won't execute this, but CI builds will
// by running "gradle check" (see the dependsOn() further down).
task integrationTest(type: Test) {
useJUnitPlatform {
includeTags 'integration'
}
dependsOn build
shouldRunAfter test
testLogging.showStandardStreams = true
}

// Integration tests require the dt sidecar to be running
exclude 'com/microsoft/durabletask/IntegrationTests.class'
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.stream.IntStream;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
Expand All @@ -29,6 +30,7 @@
* running on the local machine (the sidecar is what accepts the client operations and
* sends invocation instructions to the DurableTaskWorker).
*/
@Tag("integration")
public class IntegrationTests {
static final Duration defaultTimeout = Duration.ofSeconds(100);

Expand Down Expand Up @@ -89,7 +91,7 @@ void singleTimer() throws IOException {
}

@Test
public void isReplaying() throws IOException, InterruptedException {
void isReplaying() throws IOException, InterruptedException {
final String orchestratorName = "SingleTimer";
DurableTaskGrpcWorker worker = this.createWorkerBuilder()
.addOrchestrator(orchestratorName, ctx -> {
Expand Down