Skip to content

Commit cf82568

Browse files
committed
Add anthropicInferenceTest Gradle task without wiring to inferencePostCommitIT
Define the task so it can be invoked manually or wired in later once an ANTHROPIC_API_KEY secret is available in Apache CI. Addresses review feedback from @jrmccluskey.
1 parent 412d534 commit cf82568

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

sdks/python/test-suites/dataflow/common.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,34 @@ task geminiInferenceTest {
537537
}
538538
}
539539

540+
// Anthropic RunInference IT tests
541+
task anthropicInferenceTest {
542+
dependsOn 'initializeForDataflowJob'
543+
dependsOn ':sdks:python:sdist'
544+
def requirementsFile = "${rootDir}/sdks/python/apache_beam/ml/inference/anthropic_tests_requirements.txt"
545+
doFirst {
546+
exec {
547+
executable 'sh'
548+
args '-c', ". ${envdir}/bin/activate && pip install -r $requirementsFile"
549+
}
550+
}
551+
doLast {
552+
def testOpts = basicTestOpts
553+
def argMap = [
554+
"test_opts": testOpts,
555+
"suite": "AnthropicTests-df-py${pythonVersionSuffix}",
556+
"collect": "anthropic_postcommit" ,
557+
"runner": "TestDataflowRunner",
558+
"requirements_file": "$requirementsFile"
559+
]
560+
def cmdArgs = mapToArgString(argMap)
561+
exec {
562+
executable 'sh'
563+
args '-c', ". ${envdir}/bin/activate && ${runScriptsDir}/run_integration_test.sh $cmdArgs"
564+
}
565+
}
566+
}
567+
540568
task installTFTRequirements {
541569
dependsOn 'initializeForDataflowJob'
542570
doLast {

0 commit comments

Comments
 (0)