Skip to content

Commit 5712246

Browse files
author
Yingjian Wu
committed
wip
rebase wip wip wip Asda Asda Asda asda asda asda asda asda asda asda asda asda asda asda asda asda asda asda asda asda asda asda asda Adas Adas Adas Adas Adas Adas Adas wip wip wip Adas wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip wip
1 parent be5cb17 commit 5712246

File tree

68 files changed

+2738
-991
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2738
-991
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Run [aurora]functional tests on pull requests"
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
# test against JDK 17
11+
java: [ 17 ]
12+
name: Functional tests with Java ${{ matrix.java }}
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Setup jdk
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: ${{ matrix.java }}
19+
- uses: actions/cache@v4
20+
id: gradle-cache
21+
with:
22+
path: ~/.gradle/caches
23+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle/dependency-locks/*.lockfile') }}
24+
restore-keys: |
25+
- ${{ runner.os }}-gradle-
26+
- uses: actions/cache@v4
27+
id: gradle-wrapper-cache
28+
with:
29+
path: ~/.gradle/wrapper
30+
key: ${{ runner.os }}-gradlewrapper-${{ hashFiles('gradle/wrapper/*') }}
31+
restore-keys: |
32+
- ${{ runner.os }}-gradlewrapper-
33+
- name: Build with Gradle
34+
run: ./gradlew --info --stacktrace functionalTestAurora
35+
env:
36+
CI_NAME: github_actions
37+
CI_BUILD_NUMBER: ${{ github.sha }}
38+
CI_BUILD_URL: 'https://github.com/${{ github.repository }}'
39+
CI_BRANCH: ${{ github.ref }}
40+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
if: ${{ failure() }} |
42+
- name=$(date +"%Y-%m-%d") && cat ./metacat-functional-tests/build/logs/metacat/catalina.$name.log
43+
- name=$(date +"%Y-%m-%d") && cat ./metacat-functional-tests/build/logs/metacat/localhost.$name.log
44+
- cat ./metacat-functional-tests/build/logs/metacat/spring.log
45+
46+
# Add a step to upload the test report
47+
- name: Upload Test Report
48+
if: always()
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: test-report
52+
path: |
53+
**/build/reports/tests/functionalTestAurora
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Run [crdb]functional tests on pull requests"
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
# test against JDK 17
11+
java: [ 17 ]
12+
name: Functional tests with Java ${{ matrix.java }}
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Setup jdk
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: ${{ matrix.java }}
19+
- uses: actions/cache@v4
20+
id: gradle-cache
21+
with:
22+
path: ~/.gradle/caches
23+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle/dependency-locks/*.lockfile') }}
24+
restore-keys: |
25+
- ${{ runner.os }}-gradle-
26+
- uses: actions/cache@v4
27+
id: gradle-wrapper-cache
28+
with:
29+
path: ~/.gradle/wrapper
30+
key: ${{ runner.os }}-gradlewrapper-${{ hashFiles('gradle/wrapper/*') }}
31+
restore-keys: |
32+
- ${{ runner.os }}-gradlewrapper-
33+
- name: Build with Gradle
34+
run: ./gradlew --info --stacktrace functionalTestCRDB
35+
env:
36+
CI_NAME: github_actions
37+
CI_BUILD_NUMBER: ${{ github.sha }}
38+
CI_BUILD_URL: 'https://github.com/${{ github.repository }}'
39+
CI_BRANCH: ${{ github.ref }}
40+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
if: ${{ failure() }} |
42+
- name=$(date +"%Y-%m-%d") && cat ./metacat-functional-tests/build/logs/metacat/catalina.$name.log
43+
- name=$(date +"%Y-%m-%d") && cat ./metacat-functional-tests/build/logs/metacat/localhost.$name.log
44+
- cat ./metacat-functional-tests/build/logs/metacat/spring.log
45+
46+
# Add a step to upload the test report
47+
- name: Upload Test Report
48+
if: always()
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: test-report-crdb
52+
path: |
53+
**/build/reports/tests/functionalTestCRDB

.github/workflows/nebula-pr-functional-tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ jobs:
4242
- name=$(date +"%Y-%m-%d") && cat ./metacat-functional-tests/build/logs/metacat/catalina.$name.log
4343
- name=$(date +"%Y-%m-%d") && cat ./metacat-functional-tests/build/logs/metacat/localhost.$name.log
4444
- cat ./metacat-functional-tests/build/logs/metacat/spring.log
45-
4645
# Add a step to upload the test report using version v4
4746
- name: Upload Test Report
47+
if: always()
4848
uses: actions/upload-artifact@v4
4949
with:
5050
name: test-report-functional
51-
path: /home/runner/work/metacat/metacat/metacat-metadata/build/reports/functionalTest
51+
path: |
52+
**/build/reports/functionalTest

.github/workflows/nebula-pull-request.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,11 @@ jobs:
4242
- name=$(date +"%Y-%m-%d") && cat ./metacat-functional-tests/build/logs/metacat/catalina.$name.log
4343
- name=$(date +"%Y-%m-%d") && cat ./metacat-functional-tests/build/logs/metacat/localhost.$name.log
4444
- cat ./metacat-functional-tests/build/logs/metacat/spring.log
45+
# Add a step to upload the test report
46+
- name: Upload Test Report
47+
if: always()
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: test-report
51+
path: |
52+
**/build/reports/tests/test

metacat-common-server/src/main/java/com/netflix/metacat/common/server/properties/Config.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,5 +657,12 @@ public interface Config {
657657
* @return True if it should be.
658658
*/
659659
boolean isDefinitionMetadataSelectForUpdateEnabled();
660+
661+
/**
662+
* Whether aurora data source is enabled.
663+
*
664+
* @return True if it is.
665+
*/
666+
boolean isAuroraDataSourceEnabled();
660667
}
661668

metacat-common-server/src/main/java/com/netflix/metacat/common/server/properties/DefaultConfigImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,4 +713,9 @@ public ParentChildRelationshipProperties getParentChildRelationshipProperties()
713713
public boolean isDefinitionMetadataSelectForUpdateEnabled() {
714714
return this.metacatProperties.getUsermetadata().isDefinitionMetadataSelectForUpdateEnabled();
715715
}
716+
717+
@Override
718+
public boolean isAuroraDataSourceEnabled() {
719+
return this.metacatProperties.getService().isAuroraDataSourceEnabled();
720+
}
716721
}

metacat-common-server/src/main/java/com/netflix/metacat/common/server/properties/MetacatProperties.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,16 @@ public MetacatProperties(final Environment env) {
8282
this.env = env;
8383
this.parentChildRelationshipProperties = new ParentChildRelationshipProperties(env);
8484
}
85+
86+
/**
87+
* Constructor for MetacatProperties.
88+
*
89+
* @param env Spring Environment
90+
* @param isAuroraEnabled isAuroraEnabled
91+
*/
92+
public MetacatProperties(final Environment env, final boolean isAuroraEnabled) {
93+
this.env = env;
94+
this.parentChildRelationshipProperties = new ParentChildRelationshipProperties(env);
95+
this.getService().setAuroraDataSourceEnabled(isAuroraEnabled);
96+
}
8597
}

metacat-common-server/src/main/java/com/netflix/metacat/common/server/properties/ServiceProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class ServiceProperties {
3737
private Tables tables = new Tables();
3838
private boolean listTableNamesByDefaultOnGetDatabase = true;
3939
private boolean listDatabaseNameByDefaultOnGetCatalog = true;
40+
private boolean auroraDataSourceEnabled;
4041
private int listTableEntitiesPageSize = 1000;
4142
private int listTableNamesPageSize = 10000;
4243
private int listDatabaseEntitiesPageSize = 1000;

metacat-common-server/src/test/groovy/com/netflix/metacat/common/server/events/MetacatApplicationEventMulticasterSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import spock.lang.Specification
1515
*/
1616
class MetacatApplicationEventMulticasterSpec extends Specification {
1717
def registry = Mock(Registry)
18-
def bus = new MetacatApplicationEventMulticaster(registry, new MetacatProperties())
18+
def bus = new MetacatApplicationEventMulticaster(registry, new MetacatProperties(null))
1919
def event = Mock(ApplicationEvent)
2020

2121
def testPost() {

metacat-common-server/src/test/groovy/com/netflix/metacat/common/server/events/MetacatEventBusSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import spock.lang.Specification
1515
*/
1616
class MetacatEventBusSpec extends Specification {
1717
def registry = Mock(Registry)
18-
def eventMulticaster = Spy(MetacatApplicationEventMulticaster, constructorArgs:[registry, new MetacatProperties()])
18+
def eventMulticaster = Spy(MetacatApplicationEventMulticaster, constructorArgs:[registry, new MetacatProperties(null)])
1919
def bus = new MetacatEventBus(eventMulticaster, new NoopRegistry())
2020
def event = Mock(ApplicationEvent)
2121

0 commit comments

Comments
 (0)