File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 7
7
push :
8
8
branches : [main]
9
9
10
+ workflow_dispatch :
11
+
12
+ workflow_call :
13
+ inputs :
14
+ test_data_branch :
15
+ type : string
16
+ description : The branch in sdk-test-data to target for testcase files
17
+ required : false
18
+ default : main
19
+ sdk_branch :
20
+ type : string
21
+ description : The branch of the SDK to test
22
+ required : false
23
+
10
24
env :
11
25
ORG_GRADLE_PROJECT_ossrhUsername : ${{ secrets.OSSRH_USERNAME }}
12
26
ORG_GRADLE_PROJECT_ossrhPassword : ${{ secrets.OSSRH_PASSWORD }}
13
27
CI : true
28
+ SDK_BRANCH : ${{ inputs.sdk_branch || github.head_ref || github.ref_name || 'main' }}
29
+ TEST_DATA_BRANCH : ${{ inputs.test_data_branch || 'main' }}
14
30
15
31
jobs :
16
32
lint-test-sdk :
21
37
steps :
22
38
- uses : actions/checkout@v4
23
39
with :
40
+ repository : Eppo-exp/sdk-common-jdk
41
+ ref : ${{ env.SDK_BRANCH }}
24
42
fetch-depth : 0
25
43
26
44
- name : Set up JDK ${{ matrix.java-version }}
32
50
gpg-passphrase : ${{ secrets.GPG_PASSPHRASE }}
33
51
34
52
- name : Run tests
35
- run : make test
53
+ run : make test branchName=${TEST_DATA_BRANCH}
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ test-data:
40
40
mkdir -p ${tempDir}
41
41
git clone -b ${branchName} --depth 1 --single-branch ${githubRepoLink} ${gitDataDir}
42
42
cp -r ${gitDataDir} /ufc ${testDataDir}
43
- rm ${testDataDir} /ufc/bandit-tests/* .dynamic-typing.json
43
+ rm -f ${testDataDir} /ufc/bandit-tests/* .dynamic-typing.json || true
44
44
rm -rf ${tempDir}
45
45
46
46
.PHONY : test
Original file line number Diff line number Diff line change 39
39
public class BaseEppoClientTest {
40
40
private static final Logger log = LoggerFactory .getLogger (BaseEppoClientTest .class );
41
41
private static final String DUMMY_FLAG_API_KEY = "dummy-flags-api-key" ; // Will load flags-v1
42
- private static final String TEST_HOST =
42
+
43
+ // Use branch if specified by env variable `TEST_DATA_BRANCH`.
44
+ private static final String TEST_BRANCH = System .getenv ("TEST_DATA_BRANCH" );
45
+ private static final String TEST_HOST_BASE =
43
46
"https://us-central1-eppo-qa.cloudfunctions.net/serveGitHubRacTestFile" ;
47
+ private static final String TEST_HOST =
48
+ TEST_HOST_BASE + (TEST_BRANCH != null ? "/b/" + TEST_BRANCH : "" );
49
+
44
50
private final ObjectMapper mapper =
45
51
new ObjectMapper ().registerModule (AssignmentTestCase .assignmentTestCaseModule ());
46
52
You can’t perform that action at this time.
0 commit comments