Failures when running Keycloak Testsuite with external Keycloak server - keycloak

I am trying to run the keycloak Testsuite against an external Keycloak server that I have created.
I am using the base tests in the integration-arquillian using the following commands
mvn -f testsuite/integration-arquillian/tests/base/pom.xml clean install --log-file My_testsuite_integration_logs06.txt -Pauth-server-wildfly -Dauth.server.ssl.required=false -Dpageload.timeout=3600000 -Dauth.server.host={my-server-details} -Dauth.server.http.port={port#}
It works when I am using the embedded tests, but when I add the server details as stated in the HOW-TO-RUN.md file its failing.
https://github.com/keycloak/keycloak/tree/stage/testsuite/integration-arquillian
========
[INFO] Running org.keycloak.testsuite.account.AccountFormServiceTest
11:56:38,313 ERROR [org.keycloak.testsuite.account.AccountFormServiceTest] [AccountFormServiceTest] null() FAILED
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.003 s <<< FAILURE! - in org.keycloak.testsuite.account.AccountFormServiceTest
[ERROR] org.keycloak.testsuite.account.AccountFormServiceTest Time elapsed: 0.003 s <<< ERROR!
java.lang.RuntimeException: Arquillian initialization has already been attempted, but failed. See previous exceptions for cause
at org.jboss.arquillian.junit.AdaptorManagerWithNotifier.handleSuiteLevelFailure(AdaptorManagerWithNotifier.java:36)
at org.jboss.arquillian.junit.AdaptorManager.initializeAdaptor(AdaptorManager.java:16)
at org.jboss.arquillian.junit.AdaptorManagerWithNotifier.initializeAdaptor(AdaptorManagerWithNotifier.java:19)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:109)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Caused by: org.jboss.arquillian.container.spi.client.container.LifecycleException: The java process starting the managed server exited unexpectedly with code [2]
at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:152)
at org.jboss.as.arquillian.container.CommonDeployableContainer.start(CommonDeployableContainer.java:123)
...
==
Getting similiar to above for all my tests and not sure why it is failing.
any help be great.

Your description of the issue is quiet vague, but have you tried
mvn -f testsuite/integration-arquillian/tests/base/pom.xml clean install -Pauth-server-remote -Dauth.server.ssl.required=false Dpageload.timeout=3600000 -Dauth.server.host={my-server-details} -Dauth.server.http.port={port#}
The Profile defined could be where the issue lies.
If you take a look at the documentation https://github.com/keycloak/keycloak/blob/stage/testsuite/integration-arquillian/HOW-TO-RUN.md#remote-server-tests
It shows you how to build the keycloak server from source and run it (remote or local) and the above command is then used to run tests against this solution. Take note of
"The testsuite currently doesn't work with port 80."

Related

How to run e2e tests on custom cluster within Kubernetes.

https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-tests.md#testing-against-local-clusters
I have been following the above guide, but I keep getting this error:
2017/07/12 09:53:58 util.go:131: Step './cluster/kubectl.sh version --match-server-version=false' finished in 20.604745ms
2017/07/12 09:53:58 util.go:129: Running: ./hack/e2e-internal/e2e-status.sh
WARNING: The bash deployment for AWS is obsolete. The
v1.5.x releases are the last to support cluster/kube-up.sh with AWS.
For a list of viable alternatives, (...)
2017/07/12 09:53:58 util.go:131: Step './hack/e2e-internal/e2e-status.sh' finished in 18.71843ms
2017/07/12 09:53:58 main.go:216: Something went wrong: encountered 2 errors: [error during ./cluster/kubectl.sh version --match-server-version=false: exit status 1 error during ./hack/e2e-internal/e2e-status.sh: exit status 1]
2017/07/12 09:53:58 e2e.go:78: err: exit status 1
How do I fix this, what am I doing wrong?
If you just want to execute e2e tests without setting up the whole cluster, you can compile them from kubernetes repository: make all WHAT=test/e2e/e2e.test, and then run this compiled e2e binary against your cluster: ./e2e.test --host="<your apiserver>" --provider=local --kubeconfig=<kubeconfig location> -ginkgo.Focus="/[Conformance/]". Conformance tests should pass for any kubernetes cluster, but of course you can set any filter you want. To list all available tests, type: ./e2e.test --ginkgo.DryRun.
Some supplements
You can also compile ginkgo:
make WHAT=vendor/github.com/onsi/ginkgo/ginkgo
Some options are useful:(ginkgo --help to see details)
-flakeAttempts
-focus
-nodes
-outputdir
-skip
-v
To run tests parellely:(set --node=1 for serial tests)
./_output/bin/ginkgo --nodes=25 --flakeAttempts=2 \
./_output/bin/e2e.test -- --host="http://127.0.0.1:8080" \
--provider="local" --ginkgo.v=true --kubeconfig="~/.kube/config" \
--ginkgo.focus="Conformance" --ginkgo.skip="Serial|Slow" \
--ginkgo.failFast=false
And if you want to launch local cluster for e2e testing, hack/local-up-cluster.sh is handy.

DocPad plugin: odd errors when testing, hangs when including in project

I'm trying to write a DocPad plugin to import MongoDB docs into the DocPad database for use in a static website. The source code is at https://github.com/nfriedly/docpad-plugin-mongodb and it's based on https://github.com/docpad/docpad-plugin-tumblr
When I run cake test, I get this output:
cake compile
cake install
npm install (for app)
npm install (for test)
npm install (for docpad tests)
coffee compile
npm test
> docpad-plugin-mongodb#2.0.0 test c:\Users\IBM_ADMIN\docpad-plugin-mongodb
> npm run prepare_test_db && node ./out/mongodb.test.js
> docpad-plugin-mongodb#2.0.0 prepare_test_db c:\Users\IBM_ADMIN\docpad-plugin-mongodb
> mongo test/prepare_database.mongo.js
MongoDB shell version: 2.6.5
connecting to: test
connecting to: docpad_plugin_mongodb_test
mongodb
mongodb > create
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docpad.org/donate
error: An error occured:
Error: Didn't place the skeleton as the desired structure already exists
at c:\Users\IBM_ADMIN\docpad-plugin-mongodb\node_modules\docpad\out\lib\docpad.js:4107:17
at Object.cb [as oncomplete] (fs.js:168:19)
error: To report the above error, follow the guide at: http://docpad.org/bug-report
mongodb > create OK
mongodb > load plugin mongodb
mongodb > load plugin mongodb OK
mongodb > generate
mongodb > generate > action
warning: You have multiple files being written to c:\Users\IBM_ADMIN\docpad-plugin-mongodb\test\out\testData\1.json, they are:
- testData/1.json:c7
- testData/1.json:c5
Rename one of them to avoid an over-write
FAILURE: 2/3 tests ran successfully; 0 failed, 1 incomplete, 0 errors
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
c:\Users\IBM_ADMIN\docpad-plugin-mongodb\Cakefile:99
throw err;
^
Error: Process exited with error status code
at ChildProcess.<anonymous> (c:\Users\IBM_ADMIN\docpad-plugin-mongodb\Cakefile:88:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
And, when I include the module in my project, it just hangs after this:
$ docpad run
info: Welcome to DocPad v6.69.1 (local installation: c:\Users\IBM_ADMIN\watson-developer-cloud\node_modules\docpad
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docp
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: eco, mongodb
info: Environment: development
info: DocPad listening to http://0.0.0.0:9778/ on directory c:\Users\IBM_ADMIN\watson-developer-cloud\out
(And if I visit localhost:9778, it just hangs and never loads a page)
It seems like it only displays logs from plugins after the first pass is complete, so I started adding throw statements to see what it was doing. It seems that it imports things from mongo successfully, and it creates the document, but when the plugin calls document.action 'load', (err) ->, that callback is never fired.
Can anyone provide some guidance on what I'm messing up and how to get things working smoothly?
Fixed it. The TaskGroup library (apparently) once had a .once('complete', callback) event that no longer works. Switching it to .done(callback) (and fixing a couple of other small bugs) got me working now.
It still gives me the "Error: Didn't place the skeleton as the desired structure already exists" but the tests all pass now, so I'll call it a win.

Liferay ant deploy failed

I am trying to deploy my first "hello-world"-portlet for Liferay
but I get a "BUILD FAILED" when deploying it.
My folders look like this:
D:\[Code Home]\bundles\liferay-portal-6.2-ce-ga2
and
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\portlets
My build.[username].properties file contains this:
app.server.portal.dir = D:\\[Code Home]\\bundles\\liferay-portal-6.2-ce-ga2\\tomcat- 7.0.42\\webapps\\ROOT
app.server.lib.global.dir = D:\\[Code Home]\\bundles\\liferay-portal-6.2-ce-ga2\\lib\\ext
app.server.deploy.dir = D:\\[Code Home]\\bundles\\liferay-portal-6.2-ce-ga2\\tomcat-7.0.42\\webapps
app.server.type = tomcat
app.server.dir = D:\\[Code Home]\\bundles\\liferay-portal-6.2-ce-ga2\\tomcat-7.0.42
When deploying the portlet I get this:
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\portlets>ant deploy
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; sup
port was removed in 8.0
Buildfile: D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\portlets\build.xml
deploy:
BUILD FAILED
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\build-common-plugins.xml:57: The
following error occurred while executing this line:
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\build-common.xml:1387: The follow
ing error occurred while executing this line:
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\build-common.xml:1392: The follow
ing error occurred while executing this line:
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\build-common.xml:235: The followi
ng error occurred while executing this line:
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\build-common.xml:993: The followi
ng error occurred while executing this line:
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\build-common.xml:299: The followi
ng error occurred while executing this line:
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\build-common.xml:1766: The follow
ing error occurred while executing this line:
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\build-common.xml:175: D:\[Code Ho
me]\bundles\liferay-portal-6.2-ce-ga2\lib\ext does not exist.
Total time: 0 seconds
D:\[Code Home]\plugins\liferay-plugins-sdk-6.2\portlets>
any idea where the problem is?
Seems you are missing auto.deploy.dir value.
Here is my build.properties values.
app.server.type=tomcat
app.server.parent.dir=/home/maleen/workspace/liferay
app.server.tomcat.dir=${app.server.parent.dir}/tomcat-7.0.40
app.server.tomcat.deploy.dir=${app.server.tomcat.dir}/webapps
app.server.tomcat.lib.global.dir=${app.server.tomcat.dir}/lib/ext
app.server.tomcat.portal.dir=${app.server.tomcat.dir}/webapps/ROOT
auto.deploy.dir=${app.server.parent.dir}/deploy
Hope this helps.
The error message says
D:\[Code Home]\bundles\liferay-portal-6.2-ce-ga2\lib\ext does not exist.
Does it? If not: You need to either create it (e.g. unzip a bundle at that location) or configure your build.username.properties - what's this?
Look at build.properties - you'll find many values configured in there. Just like with other property files in Liferay, you should identify the value that you want to change from the default, create a file named build.username.properties (replace with your actual username) and override the value that you'd like to change - e.g. app.server.parent.dir is a good candidate to point to your unzipped bundle.
Note that Java8 is not yet officially supported by Liferay: This is a portal that runs on so many existing application server that it's a bit slower in adopting new environments. That's not to say that it won't work - only if you run into Java8 related problems, you might want to try Java7, and be slow to adopt the new features so that you can easily backport.

How do I fix server Oops error when deploying Play Framework 2.0 application as a Windows service?

I was following the processes in this very helpful post:
How do I run a Play Framework 2.0 application as a Windows service?
when I ran into trouble in Step 9. When I execute runConsole.bat, the service cycles between the running and restarting states. The full log is here:
wrapper.log
but what jumps out at me in the log are the following:
INFO|7268/0|play.core.server.NettyServer|13-12-28 13:07:28|Oops, cannot start the server.
INFO|7268/0|play.core.server.NettyServer|13-12-28 13:07:28|Configuration error: Configuration error[Cannot connect to database [default]]
...
INFO|7268/0|play.core.server.NettyServer|13-12-28 13:07:28|Caused by: org.h2.jdbc.JdbcSQLException: Database may be already in use: "Locked by another process". Possible solutions: close all other connection(s); use the server mode [90020-168]
...
INFO|wrapper|play.core.server.NettyServer|13-12-28 13:07:28|restart process due to default exit code rule
INFO|wrapper|play.core.server.NettyServer|13-12-28 13:07:28|restart internal RUNNING
INFO|wrapper|play.core.server.NettyServer|13-12-28 13:07:28|stopping process with pid/timeout 7268 45000
INFO|wrapper|play.core.server.NettyServer|13-12-28 13:07:30|process exit code: -1
...
INFO|7812/1|play.core.server.NettyServer|13-12-28 13:07:45|[error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: null
INFO|7812/1|play.core.server.NettyServer|13-12-28 13:07:45|Oops, cannot start the server.
INFO|7812/1|play.core.server.NettyServer|13-12-28 13:07:45|Configuration error: Configuration error[Cannot connect to database [default]]
repeats several times...
Half way through writing this post, I realized that before step 9., you should terminate the start.bat script which you start up in step 6. When I did this, runConsole.bat would execute normally without all the errors I list above.

Netbeans Profile JUnit 4 problem

I have a unit test that takes 200 sec to run. I am trying to use NetBeans profiler to speed it up. But the profiler doesn't run the unit test. It just creates an object of the test and exits. Doesn't run the actual test methods or #Before / #After methods.
This is a maven project with surefire and junit 4.
And partial output is below.
Profiler Agent: Waiting for connection on port 5140, timeout 10 seconds (Protocol version: 9)
Profiler Agent: Established local connection with the tool
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.cris.puzzle.solvers.SudokuSolverTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
Profiler Agent: Connection with agent closed
Profiler Agent: Connection with agent closed
Profiler Agent: Initializing...
Profiler Agent: Options: >C:/Program Files/NetBeans 6.8/profiler3/lib,5140,10<
Profiler Agent: Initialized succesfully
------------------------------------------------------------------------
BUILD SUCCESSFUL
------------------------------------------------------------------------
Total time: 14 seconds
Does anyone know how to make it work? Thank you.
There is a workaround. Move your test code into application code temporarily. Profile it and improve it. Once finished, move back your improved code to JUnit code.
Don't know, what is your OS, but in Win 7 (and probably also Vista), there is the problem with JUnit that it needs to have write permission to its directory (which is in default installation of NetBeans in Program files, and there it has not this access). But in that case, you would probably have problems with JUnit itself from the beginning.