-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quality: parameterize sdk and test data branches #72
Changes from 5 commits
2f79e73
0ec9532
7b3bfa1
9f0108f
5d3593e
d429c0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,28 @@ on: | |
paths: | ||
- '**/*' | ||
push: | ||
branches: [main] | ||
branches: [main, tp/**] | ||
|
||
workflow_dispatch: | ||
|
||
workflow_call: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Allows specifying branches when used as a reusable workflow |
||
inputs: | ||
test_data_branch: | ||
type: string | ||
description: The branch in sdk-test-data to target for testcase files | ||
required: false | ||
default: main | ||
sdk_branch: | ||
type: string | ||
description: The branch of the SDK to test | ||
required: false | ||
|
||
env: | ||
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }} | ||
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} | ||
CI: true | ||
SDK_BRANCH: ${{ inputs.sdk_branch || github.head_ref || github.ref_name || 'main' }} | ||
TEST_DATA_BRANCH: ${{ inputs.test_data_branch || 'main' }} | ||
|
||
jobs: | ||
lint-test-sdk: | ||
|
@@ -21,6 +37,8 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: Eppo-exp/sdk-common-jdk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. explicitly specify the repo and ref otherwise, when run as a reusable workflow in another repo, this would not checkout the java-common SDK as required |
||
ref: ${{ env.SDK_BRANCH }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK ${{ matrix.java-version }} | ||
|
@@ -32,4 +50,4 @@ jobs: | |
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Run tests | ||
run: make test | ||
run: make test branchName=${TEST_DATA_BRANCH} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π₯ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ test-data: | |
mkdir -p ${tempDir} | ||
git clone -b ${branchName} --depth 1 --single-branch ${githubRepoLink} ${gitDataDir} | ||
cp -r ${gitDataDir}/ufc ${testDataDir} | ||
rm ${testDataDir}/ufc/bandit-tests/*.dynamic-typing.json | ||
rm -f ${testDataDir}/ufc/bandit-tests/*.dynamic-typing.json || true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bumped into this failing when I was doing some local testing that involved temporarily deleting most of the test data/cases. We shouldn't bump over this in any real scenario but no need to have this fail at any rate |
||
rm -rf ${tempDir} | ||
|
||
.PHONY: test | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,14 @@ | |
public class BaseEppoClientTest { | ||
private static final Logger log = LoggerFactory.getLogger(BaseEppoClientTest.class); | ||
private static final String DUMMY_FLAG_API_KEY = "dummy-flags-api-key"; // Will load flags-v1 | ||
private static final String TEST_HOST = | ||
|
||
// Use branch if specified by env variable `TEST_DATA_BRANCH`. | ||
private static final String TEST_BRANCH = System.getenv("TEST_DATA_BRANCH"); | ||
private static final String TEST_HOST_BASE = | ||
"https://us-central1-eppo-qa.cloudfunctions.net/serveGitHubRacTestFile"; | ||
private static final String TEST_HOST = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
TEST_HOST_BASE + (TEST_BRANCH != null ? "/b/" + TEST_BRANCH : ""); | ||
|
||
private final ObjectMapper mapper = | ||
new ObjectMapper().registerModule(AssignmentTestCase.assignmentTestCaseModule()); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used to allow dispatching via web API (remotely triggered test run when changes are made to
sdk-test-data
)