I try to write integration tests for plugins I develop for Stash, but it seems they doesn't work in 2.11.3.
I created a plugin dummy using atlas-create-stash-plugin command to ensure that it is not my code causing troubles, but it doesn't work too.
When the Stash with integration tests launches, this message in console appears:
2014-03-13 16:07:52,871 WARN [localhost-startStop-1] c.a.plugin.manager.PluginEnabler Plugin 'mygroup.myartifact-tests' did not enable within 5 seconds.The plugin should not take this long to enable. Will only attempt to load plugin for another '25' seconds.
The complete log file can be found here: http://pastebin.com/udq2RVU3
I tried both atlas-run and atlas-integration-test commands with the same result. In the latter case it says that there are no tests in the test class, which is not surprising since the plugin containing tests won't start.
When I use atlas-run command and then navigate to Atlassian Plugin Test Console, I see this message:
It was said here that wired integration tests was broken in 2.5.0. Deleting atlassian-plugin.xml for tests as adviced did no good because Stash failed to load resources for it (obviously). I tried to run them with Stash 2.4.2 and it went smoothly, but this version is more than half a year old and it's not a good idea to run tests on 2.4.2 while developing plugins for 2.11.3+.
Is there any additional info on this issue? Any estimates on when it could be resolved? It seems like a major bug since we have to test our interoperability on production instances.
Community moderators have prevented the ability to post new answers.
This was an issue that has been fixed in AMPS (Atlassian Maven Plugin Suite) version 5.0.16 (https://ecosystem.atlassian.net/browse/AMPS-1214). Currently the Atlassian Plugin SDK hasn't been updated to use a version of AMPS with the fix yet, however if you use atlas-create-stash-plugin
you can just change the version of AMPS to 5.0.16 in there.
There is also one additional fix required to ensure the integration tests run, you need to add the following to the Stash product config in pom.xml to ensure that the tests don't start running before Stash has finished launching:
<product> <id>stash</id> ... <systemPropertyVariables> <johnson.spring.lifecycle.synchronousStartup>true</johnson.spring.lifecycle.synchronousStartup> </systemPropertyVariables> </product>
There has been an issue raised to fix this in the SDK as well for new plugins (https://ecosystem.atlassian.net/browse/AMPS-1228), but for now you can just add that config above manually.
Sorry I've been busy with other work for the last week. I checked and my pre-receive file was executable. I created a new repository like you suggested, just in case. It made no difference.
The constructor is called (and the plugin shows up in the list of plugins) but onReceive is not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
I'm afraid I'm out of ideas. If you're still testing your own plugin I would definitely like to see a copy of it, just because the smallest things might causing a problem.
Some other random questions/tips in desperation.
1. Are branch permissions working on the repository? eg. If you restrict the branch permissions are they enforced?
2. What interfaces does your class implement?
3. What does the atlassian-plugin.xml contain around your hook?
4. Just to confirm - you're enabled your repository hook?
5. Try running a clean version of Stash
Sorry I can't give you anything more concrete.
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried the example plugin with Stash 3.1.3 and got the same result as with Stash 2.2.0 - the constructor is called but onReceive() is not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
So I've fired up a clean copy of that plugin locally and tried running it on Stash 3.1.3. It wasn't working for me either, but I noticed that the pre-receive (and post-recieve) hooks weren't executable:
https://confluence.atlassian.com/display/STASHKB/Repository+is+not+updated+by+pushing+content+immediately+after+its+creation
There was a previous bug in older versions of Stash which left the rep_1 repository without executable hooks. In any case maybe check that target/stash/home/data/repositories/REPO_ID/hooks/ contains pre-receive/post-receive files that are executable. Also see what happens to newly created repositories.
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At Tru-Test we want to prevent commits to our master branch. It should only be updated by merging a pull request in Stash.
The example plugin should do exactly what I want. I only tried to create my own plugin because I couldn't get the example plugin to work. Should the example plugin work with more recent versions of Stash ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I downloaded https://bitbucket.org/atlassian/stash-example-hook-protect-ref(which should do exactly what I want), changed the amps.version in the pom.xml to match my amps version:
<amps.version>5.0.3</amps.version>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Thanks for the logs.
The second plugin is a red-herring. It's a completely different plugin, and running on an ancient version of Stash (2.2.0). The most important thing to work out is why your actual plugin isn't starting.
Can you possibly make a copy of your plugin available (or just a sample that exhibits the same behaviour) so someone can test it locally? Unfortunately the logs aren't really telling us much. Normally there would be an exception/reason in the logs to explain why it isn't starting.
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created my plugin using atlas-create-stash-plugin with JDK 1.8.0_05 on Linux Mint 16 Petra and am running stash on the same box.
Stash report:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have installed the latest UPM - 2.17.7 - and still have the same problem.
I made the constructor for my plugin class (com.trutest.PreCommitHook) log a message.
This is being logged, showing that the constructor is called, but the plugin still doesn't register.
Log file is as follows:
2014-07-29 11:56:00,612 WARN [pool-13-thread-1] admin 715x264x0 pourw8 127.0.0.1 "POST /rest/plugins/self-update/1.0/ HTTP/1.1" c.a.p.o.f.t.s.ScanDescriptorForHostClassesStage The plugin 'plugin.6724004688326892744.atlassian-universal-p
lugin-manager-plugin-2.17.7.jar' uses a package 'org.apache.commons.fileupload.servlet' that is also exported by the application. It is highly recommended that the plugin use its own packages.
2014-07-29 11:56:02,972 WARN [ThreadPoolAsyncTaskExecutor::Thread 17] admin 715x185x0 pourw8 127.0.0.1 "POST /rest/plugins/1.0/ HTTP/1.1" n.s.e.config.CacheConfiguration Cache 'UpmPluginLicenseTokenCache' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'UpmPluginLicenseTokenCache' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
2014-07-29 11:56:03,113 WARN [ThreadPoolAsyncTaskExecutor::Thread 17] admin 715x185x0 pourw8 127.0.0.1 "POST /rest/plugins/1.0/ HTTP/1.1" n.s.e.config.CacheConfiguration Cache 'HostLicenseCache' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'HostLicenseCache' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
2014-07-29 11:56:03,133 WARN [ThreadPoolAsyncTaskExecutor::Thread 17] admin 715x185x0 pourw8 127.0.0.1 "POST /rest/plugins/1.0/ HTTP/1.1" n.s.e.config.CacheConfiguration Cache 'UpmRoleBasedMetadataCache' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'UpmRoleBasedMetadataCache' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
2014-07-29 11:56:03,200 WARN [ThreadPoolAsyncTaskExecutor::Thread 17] admin 715x185x0 pourw8 127.0.0.1 "POST /rest/plugins/1.0/ HTTP/1.1" n.s.e.config.CacheConfiguration Cache 'UpmPluginLicenseCache' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'UpmPluginLicenseCache' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
2014-07-29 11:56:06,644 WARN [pool-13-thread-1] admin 715x264x0 pourw8 127.0.0.1 "POST /rest/plugins/self-update/1.0/ HTTP/1.1" c.a.upm.selfupdate.UpdateController Installed UPM update
2014-07-29 11:56:35,781 WARN [http-bio-7990-exec-8] 716x648x5 pourw8 127.0.0.1 "GET /s/d41d8cd98f00b204e9800998ecf8427e-T/en_US/faa46f8/432/2.0.12/_/download/resources/com.atlassian.devrel.developer-toolbox-plugin:dt-toolbar/toolbar.js HTTP/1.1" c.a.p.w.WebResourceTransformation Web resource transformer baseURL not found for resource toolbar.js, skipping
2014-07-29 11:57:56,227 INFO [Timer-2] c.a.s.internal.ssh.server.SshServer Stopping SSH server...
2014-07-29 11:57:56,230 INFO [Timer-2] c.a.s.internal.ssh.server.SshServer Stopped SSH server successfully.
2014-07-29 11:57:56,623 INFO [localhost-startStop-2] c.a.s.internal.home.HomeLockAcquirer Releasing lock on /home/david/atlassian/precommithook/stash-commit-hook/target/stash/home
2014-07-29 11:57:56,625 INFO [localhost-startStop-2] c.a.s.i.server.BuildInfoLogger Stash 3.1.3 has shut down
2014-07-29 11:58:34,323 INFO [localhost-startStop-1] c.a.s.i.server.BuildInfoLogger Starting Stash 3.1.3 (faa46f8 built on Wed Jul 09 01:29:27 NZST 2014)
2014-07-29 11:58:34,328 INFO [localhost-startStop-1] c.a.s.i.server.BuildInfoLogger JVM: Oracle Corporation Java HotSpot(TM) Client VM 1.8.0_05-b13
2014-07-29 11:58:35,298 INFO [localhost-startStop-1] c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory /home/david/atlassian/precommithook/stash-commit-hook/target/stash/home for 21765@david-VirtualBox
2014-07-29 11:58:36,628 WARN [localhost-startStop-1] com.jolbox.bonecp.BoneCPConfig JDBC password not set in driver properties, copying it from pool config
2014-07-29 11:58:48,164 INFO [localhost-startStop-1] com.atlassian.stash.internal.project Switching to log level [WARN]
2014-07-29 11:58:48,164 INFO [localhost-startStop-1] c.a.stash.internal.scm.git.command Switching to log level [WARN]
2014-07-29 11:58:50,672 INFO [localhost-startStop-1] c.a.s.i.hook.DefaultHookService Hook callback socket listening on 127.0.0.1:59232
2014-07-29 11:58:56,997 WARN [localhost-startStop-1] c.a.p.o.f.t.s.GenerateManifestStage The Spring Manifest header in jar 'pdkinstall-plugin-0.6.jar' isn't set for a 300 second timeout waiting for dependencies. Please add ';timeout:=300'
2014-07-29 11:58:59,418 WARN [ThreadPoolAsyncTaskExecutor::Thread 13] o.s.beans.TypeConverterDelegate PropertyEditor [com.sun.beans.editors.EnumEditor] found through deprecated global PropertyEditorManager fallback - consider using a more isolated form of registration, e.g. on the BeanWrapper/BeanFactory!
2014-07-29 11:59:01,124 WARN [ThreadPoolAsyncTaskExecutor::Thread 11] com.trutest.stash.PreCommitHook created com.trutest.stash.PreCommitHook:Stash
2014-07-29 11:59:02,181 INFO [ThreadPoolAsyncTaskExecutor::Thread 1] c.a.s.i.s.g.t.DefaultTranscodeServer Callback socket listening at 127.0.0.1:58021
2014-07-29 11:59:03,335 WARN [ThreadPoolAsyncTaskExecutor::Thread 14] n.s.e.config.CacheConfiguration Cache 'UpmPluginLicenseTokenCache' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'UpmPluginLicenseTokenCache' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
2014-07-29 11:59:03,470 WARN [ThreadPoolAsyncTaskExecutor::Thread 12] n.s.e.config.CacheConfiguration Cache 'com.atlassian.applinks.core.DefaultReadOnlyApplicationLinkService.links' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'com.atlassian.applinks.core.DefaultReadOnlyApplicationLinkService.links' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
2014-07-29 11:59:03,722 WARN [ThreadPoolAsyncTaskExecutor::Thread 14] n.s.e.config.CacheConfiguration Cache 'HostLicenseCache' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'HostLicenseCache' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
2014-07-29 11:59:03,814 WARN [ThreadPoolAsyncTaskExecutor::Thread 14] n.s.e.config.CacheConfiguration Cache 'UpmRoleBasedMetadataCache' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'UpmRoleBasedMetadataCache' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
2014-07-29 11:59:04,313 WARN [ThreadPoolAsyncTaskExecutor::Thread 14] n.s.e.config.CacheConfiguration Cache 'UpmPluginLicenseCache' is set to eternal but also has TTI/TTL set. To avoid this warning, clean up the config removing conflicting values of eternal, TTI and TTL. Effective configuration for Cache 'UpmPluginLicenseCache' will be eternal='true', timeToIdleSeconds='0', timeToLiveSeconds='0'.
2014-07-29 11:59:10,627 WARN [localhost-startStop-1] c.a.plugin.manager.PluginEnabler Plugin 'com.trutest.stash-commit-hook-tests' did not enable within 5 seconds.The plugin should not take this long to enable. Will only attempt to load plugin for another '25' seconds.
2014-07-29 11:59:31,633 WARN [active-objects-ddl-0] c.a.a.o.AOConfigurationServiceProviderImpl Timeout (30000 MILLISECONDS) waiting for ActiveObjectConfiguration for Bundle : com.atlassian.stash.stash-audit [70].
To avoid this warning add an ao configuration module to your plugin
2014-07-29 11:59:31,635 WARN [active-objects-ddl-0] c.a.a.o.AOConfigurationServiceProviderImpl Didn't find any configuration service for bundle com.atlassian.stash.stash-audit nor any entities scanning for default AO packages.
2014-07-29 11:59:31,637 WARN [ListenableFutureAdapter-thread-0] c.a.a.o.ActiveObjectsServiceFactory Resubmitting AO bundle with longer timeout 180000 ms for bundle : com.atlassian.stash.stash-audit [70]
2014-07-29 11:59:35,652 ERROR [localhost-startStop-1] c.a.plugin.manager.PluginEnabler Unable to start the following plugins due to timeout while waiting for plugin to enable: com.trutest.stash-commit-hook-tests
2014-07-29 11:59:36,440 WARN [localhost-startStop-1] c.a.s.i.p.OsgiBundledPathScanner Cannot scan directory /com/atlassian/oauth/shared/servlet/ in bundle com.atlassian.oauth.atlassian-oauth-service-provider-plugin as it does not exist
2014-07-29 11:59:40,355 INFO [localhost-startStop-1] c.a.s.internal.ssh.server.SshServer Starting SSH server on port 7999...
2014-07-29 11:59:40,451 INFO [localhost-startStop-1] c.a.s.internal.ssh.server.SshServer Started SSH server successfully.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using UPM v2.16.5.
The log file says
[INFO] [talledLocalContainer] 2014-07-29 11:22:37,437 WARN [localhost-startStop-1] c.a.plugin.manager.PluginEnabler Plugin 'com.trutest.stash-commit-hook-tests' did not enable within 5 seconds.The plugin should not take this long to enable. Will only attempt to load plugin for another '25' seconds.
and then
[INFO] [talledLocalContainer] 2014-07-29 11:23:02,464 ERROR [localhost-startStop-1] c.a.plugin.manager.PluginEnabler Unable to start the following plugins due to timeout while waiting for plugin to enable: com.trutest.stash-commit-hook-tests
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same problem and the bitbucket link for the workaround above no longer works. Where can I find a version of the osgi-testrunner plugin that will enable me to develop and test plugins for stash ?
Adding the following arguments to the atlas-run command line seems to have no effect:
--jvmargs -Datlassian.plugins.enable.wait=300
It still complains that my plugin is not started after 30 seconds, not 300.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
What errors are you seeing? Ignore the link above, the branch it was pointing to has been merged, and was released in 1.2.0.
https://bitbucket.org/atlassian/atlassian-plugins-osgi-testrunner-parent/commits/all
If you're seeing errors like Alexander it could be related to your UPM version:
https://answers.atlassian.com/questions/114252/not-found-404-com-atlassian-upm-api-util-option
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same problem and the bitbucket link for the workaround above no longer works. Where can I find a version of the osgi-testrunner plugin that will enable me to develop and test plugins for stash ?
Adding the following arguments to the atlas-run command line seems to have no effect:
--jvmargs -Datlassian.plugins.enable.wait=300
It still complains that my plugin is not started after 30 seconds, not 300.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same problem and the bitbucket link for the workaround above no longer works. Where can I find a version of the osgi-testrunner plugin that will enable me to develop and test plugins for stash ?
Adding the following arguments to the atlas-run command line seems to have no effect:
--jvmargs -Datlassian.plugins.enable.wait=300
It still complains that my plugin is not started after 30 seconds, not 300.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guys,
Sorry for the delay. I'm looking to get a fix into the next version of the SDK.
For now if you build and install the osgi-testrunner plugin on this branch you should get everything to work. Please let me know if this isn't the case.
https://bitbucket.org/atlassian/atlassian-plugins-osgi-testrunner-parent/branch/bugfix%2FPTRUNNER-23-context-path-fixes
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried version 1.2.0 of testrunner but unfortunately still unable to fix tests.
I'm getting an exception when my test is running: http://pastebin.com/qmpynNBw
The plugin was created usin command atlas-create-stash-plugin and was unchanged. I'm using Stash v.2.12.1 and Atlassian SDK v.4.2.20. You can find the full log output here: http://pastebin.com/MC3XF7Fh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Additional info.
It seems like things stopped working since version 1.1.5 of testrunner. While forcing Stash v2.4.2 for refapp plugin it only works with versions of testrunner prior to 1.1.5 where UpmOptionAdapter was introduced. Starting from this version it stops working with exception "java.lang.NoClassDefFoundError: com/atlassian/upm/api/util/Option".
So I can't check if fixes introduced in 1.2.0 solve the problem with integration tests.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm also getting the same problem. ow to solve this.. I struck here. any help.
Even I raised a thread for this see below one please.
https://answers.atlassian.com/questions/272762/merge-check-plugin-problem
Thanks in advance
Anil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.