Skip to content
Open
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
26 changes: 26 additions & 0 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,38 @@ jobs:
# Give additional time for gRPC service to fully initialize after port is open
sleep 5

- name: Initialize Azurite (Azure Blob Storage Emulator)
run: docker run --name azurite -p 10000:10000 -d mcr.microsoft.com/azure-storage/azurite azurite-blob --blobHost 0.0.0.0

- name: Wait for Azurite to be ready
run: |
echo "Waiting for Azurite to be ready on port 10000..."
MAX_WAIT_SECONDS=60
attempt=0
while ! (echo > /dev/tcp/localhost/10000) 2>/dev/null; do
attempt=$((attempt + 1))
if [ $attempt -ge $MAX_WAIT_SECONDS ]; then
echo "ERROR: Azurite not ready after $MAX_WAIT_SECONDS seconds"
echo "Docker container status:"
docker ps -a
echo "Container logs:"
docker logs azurite 2>&1 | tail -50
exit 1
fi
echo "Attempt $attempt/$MAX_WAIT_SECONDS - waiting for Azurite..."
sleep 1
done
echo "Azurite is ready on port 10000"

- name: Integration Tests with Gradle
run: ./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
continue-on-error: true

- name: Kill Durable Task Emulator
run: docker kill durabletask-emulator

- name: Kill Azurite
run: docker kill azurite

- name: Upload Durable Task Emulator Logs
uses: actions/upload-artifact@v4
Expand Down
116 changes: 116 additions & 0 deletions azure-blob-payloads/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'com.github.spotbugs' version '6.4.8'
}

group 'com.microsoft'
version = '1.8.0'
archivesBaseName = 'durabletask-azure-blob-payloads'

def grpcVersion = '1.78.0'
def azureCoreVersion = '1.57.1'
def azureStorageBlobVersion = '12.29.1'

// Java 11 is used to compile and run all tests. Set the JDK_11 env var to your
// local JDK 11 home directory, e.g. C:/Program Files/Java/openjdk-11.0.12_7/
// If unset, falls back to the current JDK running Gradle.
def rawJdkPath = System.env.JDK_11 ?: System.getProperty("java.home")
def PATH_TO_TEST_JAVA_RUNTIME = rawJdkPath
if (rawJdkPath != null) {
def f = new File(rawJdkPath)
if (f.isFile()) {
PATH_TO_TEST_JAVA_RUNTIME = f.parentFile.parentFile.absolutePath
}
}
def isWindows = System.getProperty("os.name").toLowerCase().contains("win")
def exeSuffix = isWindows ? ".exe" : ""

dependencies {
api project(':client')

// Azure Storage Blobs
implementation "com.azure:azure-storage-blob:${azureStorageBlobVersion}"

// TokenCredential abstraction (from azure-core)
implementation "com.azure:azure-core:${azureCoreVersion}"

// gRPC interceptor API
implementation "io.grpc:grpc-api:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"

// NOTE: azure-identity is NOT included here. Users who need
// DefaultAzureCredential should add it to their own project.

testImplementation 'org.mockito:mockito-core:5.21.0'
testImplementation 'org.mockito:mockito-junit-jupiter:5.21.0'
testImplementation project(':azuremanaged')
}

compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
options.fork = true
options.forkOptions.executable = "${PATH_TO_TEST_JAVA_RUNTIME}/bin/javac${exeSuffix}"
}

tasks.withType(Test) {
executable = new File("${PATH_TO_TEST_JAVA_RUNTIME}", "bin/java${exeSuffix}")
}

test {
useJUnitPlatform {
// Skip tests tagged as "integration" since those require
// external dependencies (DTS emulator + Azurite).
excludeTags "integration"
}
}

// Integration tests require DTS emulator (default localhost:4001) and Azurite on localhost:10000.
task integrationTest(type: Test) {
useJUnitPlatform {
includeTags 'integration'
}
dependsOn build
shouldRunAfter test
testLogging.showStandardStreams = true
ignoreFailures = false
}

spotbugs {
toolVersion = '4.9.8'
effort = com.github.spotbugs.snom.Effort.valueOf('MAX')
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('HIGH')
ignoreFailures = true
excludeFilter = file('spotbugs-exclude.xml')
}

spotbugsMain {
reports {
html {
required = true
stylesheet = 'fancy-hist.xsl'
}
xml {
required = true
}
}
}

spotbugsTest {
reports {
html {
required = true
stylesheet = 'fancy-hist.xsl'
}
xml {
required = true
}
}
}
17 changes: 17 additions & 0 deletions azure-blob-payloads/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<!-- Exclude test classes -->
<Match>
<Class name="~.*Test"/>
</Match>

<!-- Exclude common false positives -->
<Match>
<BugPattern name="DM_CONVERT_CASE"/>
</Match>

<!-- Exclude serialization related warnings -->
<Match>
<BugPattern name="SE_NO_SERIALVERSIONID"/>
</Match>
</FindBugsFilter>
Loading
Loading