Skip to content

Commit

Permalink
Merge ce9c292 into 0fbc0fe
Browse files Browse the repository at this point in the history
  • Loading branch information
gmokki committed Jan 11, 2022
2 parents 0fbc0fe + ce9c292 commit 1d9fce9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ on:
branches-ignore:
- 'master'
concurrency:
group: ${{ github.head_ref }}
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
java: [ '8', '11' ]
db: h2, mariadb
db: [ 'h2', 'mariadb' ]
runs-on: ubuntu-latest
env:
SPRING_PROFILES_ACTIVE=nflow.db.${{ matrix.java }}
SPRING_PROFILES_ACTIVE: nflow.db.${{ matrix.db }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -26,5 +26,7 @@ jobs:
cache: 'maven'
- name: Setup DB
run: ./travis/setup-db-${{ matrix.db }}.sh
- name: Run the Maven verify phase
run: mvn -B -P ${{ matrix.java }} test
- name: Create frontend package
run: mvn -X -B -pl nflow-explorer install
- name: Run the Maven test phase
run: mvn -X -B -P ${{ matrix.db }} test
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ public static void start() throws Exception {
.prop("nflow.dispatcher.sleep.ms", 5)
.prop("nflow.dispatcher.sleep.ms", 2)
.springContextClass(DemoConfiguration.class).build());
servers.get(0).before();
servers.get(0).before("ConcurrentEnginesTest");
for (int i=1; i<ENGINES; ++i) {
NflowServerConfig server = servers.get(0).anotherServer();
servers.add(server);
server.before();
server.before("ConcurrentEnginesTest");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ public void setSpringContextClass(Class<?> springContextClass) {
this.springContextClass = springContextClass;
}

public void before() throws Exception {
public void before(String testName) throws Exception {
if (getInstanceName() == null) {
props.put("nflow.executor.group", testName);
}
startDb();
startJetty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void beforeAll(ExtensionContext context) throws Exception {
Field configField = fields.get(0);
config = (NflowServerConfig) configField.get(null);
logger.debug("Initialize with {}: {}", NflowServerConfig.class.getSimpleName(), config);
config.before();
config.before(testClass.getSimpleName());
}

@Override
Expand Down
16 changes: 8 additions & 8 deletions travis/setup-db-sqlserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=passWord1%' --publish 1433:1433 -

sleep 5

docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -Q "create database nflow"
docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "create login [nflow] with password='nFlow42%', default_database=[nflow]"
docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "create user [nflow] for login [nflow] with default_schema=[nflow]"
docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "create schema nflow authorization nflow"
docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "grant connect to [nflow]"
docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "alter role db_datareader add member nflow"
docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "alter role db_datawriter add member nflow"
docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "grant all to [nflow]"
docker exec -t mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -Q "create database nflow"
docker exec -t mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "create login [nflow] with password='nFlow42%', default_database=[nflow]"
docker exec -t mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "create user [nflow] for login [nflow] with default_schema=[nflow]"
docker exec -t mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "create schema nflow authorization nflow"
docker exec -t mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "grant connect to [nflow]"
docker exec -t mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "alter role db_datareader add member nflow"
docker exec -t mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "alter role db_datawriter add member nflow"
docker exec -t mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P passWord1% -e -x -d nflow -Q "grant all to [nflow]"

0 comments on commit 1d9fce9

Please sign in to comment.