Conversation
Yep, it was a bit tricky. The Oracle Docker image starts |
.travis.yml
Outdated
| language: java | ||
| before_install: | ||
| - docker run --name dbfitdb2 -d -p 50000:50000 -v "`pwd`/dbfit-java/db2/src/integration-test/resources:/var/dbfit/dbfit-java/db2/src/integration-test/resources" -e DB2INST1_PASSWORD=db2inst1-pwd -e LICENSE=accept ibmcom/db2express-c:latest db2start | ||
| - docker exec dbfitdb2 /var/dbfit/dbfit-java/db2/src/integration-test/resources/create_db_schema.sh |
There was a problem hiding this comment.
Also I moved the oracle scripts below from java resources folder to test_vm/scripts - since it's not exactly a Java resource. Maybe we can do the same for db2?
There was a problem hiding this comment.
Indeed. I meant to ask you about that. I've got shell and SQL scripts for this one. Do you think we should bother having shell and sql directories?
There was a problem hiding this comment.
The reason I placed the .sql in separate folder alone is because the Oracle docker startup script is picking everything from the given path and running it.
.travis.yml
Outdated
|
|
||
| language: java | ||
| before_install: | ||
| - docker run --name dbfitdb2 -d -p 50000:50000 -v "`pwd`/dbfit-java/db2/src/integration-test/resources:/var/dbfit/dbfit-java/db2/src/integration-test/resources" -e DB2INST1_PASSWORD=db2inst1-pwd -e LICENSE=accept ibmcom/db2express-c:latest db2start |
There was a problem hiding this comment.
That's a pretty long line. Can we do anything about it?
There was a problem hiding this comment.
I think putting these long command lines into shell scripts is probably the way to go. I could call a shell script instead in that before_install section.
But I'm not sure where the files from the Git repo are placed on the build server filesystem. Do you know?
There was a problem hiding this comment.
You shouldn't rely on hard-coded paths, you only rely on having current dir in the project root.
Anyway - separate script is perhaps not worth for that. Lines can be wrapped like I did in the Oracle polling script. Also these paths seem excessively long to me (do we really need so long paths?)
For Oracle, I not sure we can tell if the Oracle schema setup script has run through to completion. For DB2, I think the details are those in the In any case, the DB2 schema setup is run with I think I could create something to poll for the existence of some of the DbFit test objects. I guess that would be the best option). But, is it worth bothering right now with this as we're only adding a couple of minutes to the process? @javornikolov What do you think? |
To be honest - I think you run it in background mode anyway ( |
It's proven to be reliable so far. The DB/schema/objects creation step has never failed so the container startup seems to be a very fast method of getting the services running. May be the actual Do you think we need to do any more with this at the moment? |
|
I can see at the end of docker-entrypoint.sh it's waiting for some entries in a log file - maybe that guarantees that the db2 is up.
Perhaps not. |
|
|
||
| task travisbuild(dependsOn: [ | ||
| fastbuild, | ||
| ':dbfit-java:db2:integrationTest', |
There was a problem hiding this comment.
What about moving that to the end of the list? I think mysql is the most light-weight so good to have it on first place I think.
There was a problem hiding this comment.
Light weight because of the provisioning or because of the tests that we're running?
There was a problem hiding this comment.
It's the total time until the first test is done. It's a speculative guess so far - I don't really know whether db2 is slower or not. Maybe the order is just fine as it is.
There was a problem hiding this comment.
The DB2 tests are ready to run as soon at the before_script section has run. The complete build is taking 7 minutes to complete. I don't think moving the order will change that.
There was a problem hiding this comment.
It's more about how long it takes for a failing test to fail. But anyway - I guess the difference is negligible compared to the total time with the setup before that. OK to be as is.
This seems to come into effect when Having had a look at the log file though (it gets pretty big) I can see which is probably something we can use. So we could get the Oracle and DB2 being pulled, extracted and started up in parallel. I'll try calling the DB/schema creation then from the |
8ed6d37 to
a27c018
Compare
The log exists in the container even before I start it and the log files has a previous entry with this string. I can check for a second record in the log file (from our I think I could leave these are they were for the time being (i.e. pull DB2, then create the DB and schema objects) then do the Oracle pull/extract stuff. What do you think? |
|
Why the build has failed now? |
I need to correct the character escaping in the command line. |
ca973ee to
78aa7ce
Compare
|
Either I can't see the wood for the trees or there's something in the travis build script that's causing my docker command line to fail. Better options are i) a new shell script ii) go back to the original commit/PR. |
78aa7ce to
6460844
Compare
6460844 to
ae1ab12
Compare
73fac30 to
c827a92
Compare
c827a92 to
9cfc43d
Compare
|
@javornikolov I've done some tidying up and tried a few new moves (in order to get DB2 pulling in parallel with the Oracle pull). Would you mind doing another review please? |
.travis.yml
Outdated
|
|
||
| language: java | ||
| before_install: | ||
| - docker run --name dbfitdb2 -d -p 50000:50000 -v "`pwd`/test_vm/scripts/db2:/var/dbfit/test_vm/scripts/db2" -e DB2INST1_PASSWORD=db2inst1-pwd -e LICENSE=accept ibmcom/db2express-c:latest db2start & |
There was a problem hiding this comment.
I'm still wondering if it makes sense to have both -d and run it in background in the shell (via & suffix).
There was a problem hiding this comment.
Even /var/dbfit/test_vm/scripts/db2 is quite long path. What about mounting it e.g. under /tmp?
There was a problem hiding this comment.
I was trying to avoid too many changes to the shell scripts to maintain compatibility when they're being used to install DB2 via vagrant. I'll have another look at the scripts.
|
|
||
| task travisbuild(dependsOn: [ | ||
| fastbuild, | ||
| ':dbfit-java:db2:integrationTest', |
There was a problem hiding this comment.
It's more about how long it takes for a failing test to fail. But anyway - I guess the difference is negligible compared to the total time with the setup before that. OK to be as is.
I already took a look. It looks pretty good to me 👍 Just a minor remark about the paths length. |
20b31de to
bf73c0f
Compare
|
Ok. I've tidied up the path names now. I can't fully test that the vagrant VM build is still fully working because of #542 |
|
I'm still wondering if it makes sense to have both -d and run it in background in the shell (via & suffix).
You mean perhaps we should just run everything in the foreground?
Sent from my iPhone
On 12 Feb 2017, at 23:15, Yavor Nikolov <[email protected]<mailto:[email protected]>> wrote:
@javornikolov commented on this pull request.
________________________________
In .travis.yml<#543 (review)>:
@@ -5,13 +5,16 @@ services:
language: java
before_install:
+ - docker run --name dbfitdb2 -d -p 50000:50000 -v "`pwd`/test_vm/scripts/db2:/var/dbfit/test_vm/scripts/db2" -e DB2INST1_PASSWORD=db2inst1-pwd -e LICENSE=accept ibmcom/db2express-c:latest db2start &
I'm still wondering if it makes sense to have both -d and run it in background in the shell (via & suffix).
________________________________
In .travis.yml<#543 (review)>:
@@ -5,13 +5,16 @@ services:
language: java
before_install:
+ - docker run --name dbfitdb2 -d -p 50000:50000 -v "`pwd`/test_vm/scripts/db2:/var/dbfit/test_vm/scripts/db2" -e DB2INST1_PASSWORD=db2inst1-pwd -e LICENSE=accept ibmcom/db2express-c:latest db2start &
Even /var/dbfit/test_vm/scripts/db2 is quite long path. What about mounting it e.g. under /tmp?
________________________________
In build.gradle<#543 (review)>:
@@ -246,6 +246,7 @@ task fastbuild(dependsOn: [
task travisbuild(dependsOn: [
fastbuild,
+ ':dbfit-java:db2:integrationTest',
It's more about how long it takes for a failing test to fail. But anyway - I guess the difference is negligible compared to the total time with the setup before that. OK to be as is.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#543 (review)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABztFTEmU_Wls4By71u8RZZRFoFduJs3ks5rb5KQgaJpZM4L-T6O>.
|
|
Even /var/dbfit/test_vm/scripts/db2 is quite long path. What about mounting it e.g. under /tmp?
Now mounted at `/scripts`.
…Sent from my iPhone
On 12 Feb 2017, at 23:15, Yavor Nikolov <[email protected]<mailto:[email protected]>> wrote:
Even /var/dbfit/test_vm/scripts/db2 is quite long path. What about mounting it e.g. under /tmp?
|
I seem to have broken the vagrant build with the shell script changes. Another push required... |
bf73c0f to
d557828
Compare
Ok. The vagrant VM build is now working again with this latest push. |
I'm not sure what you meant here. Just run it all sequentially and remove the checks for the services being up? |
@MMatten, sorry I didn't mean to to suggesting anything specific (maybe it's all fine). Just I'm noting that |
Right. I see what you mean now. I had noticed that a while ago but forgot to try it without |
d557828 to
57fa3cc
Compare
It seems the difference in the behaviour, for the DB2 entry, with I'll try applying it to the Oracle container too now. |
|
I think when using |
Another few seconds is all it seems to add, perhaps as we're only running one pull/extract at a time. I think the build log is tidier too. What do you think of the options? |
What if we try both using |
|
Ok. I'll give that combination a go. I think the pull / extract messages might make a mess of the raw log (but ok when looking at the pretty version with the collapsed sections). |
b357f0f to
1df4a72
Compare
1df4a72 to
63d1d3e
Compare
That shaves about 30 seconds off of the time and the log (even the raw log) looks fine actually. Looks good to me. Any other points you've noticed? |
|
@MMatten, all looks good to me 👍 I'm merging it. Thanks a lot! |
Add DB2 integration tests to CI builds.
This seems to add roughly 2 minutes to the build time.
It might be possible run the container setup and DB scheme create as a background job, as per the Oracle/Docker setup, but I can't see how the method for Oracle ensure that the schema creation has completed successfully (@javornikolov any pointers welcomed).