Problem with dokka CLI - "Exiting Generation: Nothing to document" - kotlin

I'm trying to generate documentation for my kotlin code. Some of my classes and functions have KDOC comments.
I tried to run dokka from the CLI like this:
java -jar dokka-cli-1.4.20.jar
And the result was:
WARN: Dokka 1.4.* is an alpha project PROGRESS: Initializing plugins
Loaded plugins: [] Loaded: [
] Suppressed: [
] PROGRESS: Validity check PROGRESS: Creating documentation models
PROGRESS: Exiting Generation: Nothing to document PROGRESS:
=== TIME MEASUREMENT ===
Initializing plugins: 26
Validity check: 32
Creating documentation models: 28
Exiting Generation: Nothing to document: 1
I have tried to execute this:
in the project's folder.
in the src folder
in the first src sub-folder that has .kt files
The result was similar for all runs.
Any ideias on how to solve this? Thanks.

Related

Unreal Engine 5 Plugin: Missing import: UnrealEditor-SteamVR.dll

I have a plugin that fails to load initially when starting up my project and gives this error: The game module ‘PluginName’ could not be loaded. There may be an operating system error or the module may not be properly set up
When reviewing the log file I see that the issue is caused by:
Missing import: UnrealEditor-SteamVR.dll
If I copy this DLL from the Unreal Engine 5 plugins into my Plugin's Binary folder, the project will open as normal and load the plugin. However, this was not the case for Unreal Engine 4, so I'm trying to see why I need to copy this DLL now.
In my plugin Build CS file I have a reference to SteamVR. Maybe this needs to be updated?
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
// ... add other public dependencies that you statically link with here ...
"CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "OpenVR"
}
);
PrivateDependencyModuleNames.AddRange(new string[] { "SteamVR" });
How to get this to work without manually adding in the DLL?
I edited my .uplugin file and added the SteamVR plugin dependency, which resolved the issue.
"Plugins": [
{
"Name": "SteamVR",
"Enabled": true
}
]
Edit 1:
I discovered that though multiple Steam libs were included in my C++ it was a function from the SteamVRFunctionLibrary responsible for causing the issue on startup when the SteamVR plugin isn't enabled.

JUnit5 Console Launcher not finding tests

I've seen a number of posts on this, but none of the solutions seem to work for me.
The problem is that the JUnit5 console launcher cannot seem to find my tests, regardless of syntax that I try. I've tried scanning for them with --scan-classpath and specifying the class directly with -c, including the package specifier, which generates a NoClassDefFound.
With --scan-classpath the console launcher runs successfully, but doesn't include any unit test executions - doesn't find the test classes for some reason.
The tree looks like this:
junit-5-jars (the console standalone jar is in here)
src
mypackage
MyClass.java
MyClass.class
test
mypackage
MyClassShould.java
MyClassShould.class
From the root of that, the first and most basic command I tried:
java -jar junit5-jars/junit-platform-console-standalone-1.7.0-all.jar --class-path=test --class-path=src --scan-classpath
All variations I've tried give me:
Test run finished after 27 ms
[ 2 containers found ]
[ 0 containers skipped ]
[ 2 containers started ]
[ 0 containers aborted ]
[ 2 containers successful ]
[ 0 containers failed ]
[ 0 tests found ]
[ 0 tests skipped ]
[ 0 tests started ]
[ 0 tests aborted ]
[ 0 tests successful ]
[ 0 tests failed ]
This is on a Mac from bash. In a project with all class files at the root of where I'm running the command, I can run tests with the console launcher successfully. But if class files are in subdirectories like this, no go. Anyone have ideas? (Note - see answer below, subdirectories were not the issue - the "Should" in the test class name was).
I think I've discovered the source of this problem - it was the "Should" in the test class name, which JUnit5 ConsoleLauncher does not include to be scanned by default.
This works:
java -jar junit5-jars/junit-platform-console-standalone-1.7.0-all.jar --class-path=test:src --include-classname=.* --scan-classpath
The include classname option takes a regex, but in my case I just let it scan all the files on the classpath for tests, and it finds them as it should.
Would be helpful if the --scan-classpath description in their docs referenced the include-classname option and/or their default scanning inclusions. Easy to miss that argument in that wall of options.

Ktor - Quickstart new project from plugin throwing Error

I am using:
Kotlin 1.3.3
Ktor plugin 1.2.0
IntelliJ IDEA 2019.1.3 (Ultimate Edition) Build #IU-191.7479.7, built
on May 21, 2019
openjdk version "11.0.2" 2019-01-15 - OpenJDK Runtime Environment
18.9 (build 11.0.2+9)
macOS Mojave 10.14.5
Also tried with 'jdk1.8.0_202.jdk/'
I follow the QuickStart from https://ktor.io/quickstart/index.html
When I run the generated code from inside IntelliJ I get:
/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin/java "-javaagent:/Applications/IntelliJ IDEA 2019.1 EAP.app/Contents/lib/idea_rt.jar=50192:/Applications/IntelliJ IDEA 2019.1 EAP.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath /Users/NOTiFY/IdeaProjects/HelloKtorWorld/out/production/classes:/Users/NOTiFY/IdeaProjects/HelloKtorWorld/out/production/resources:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-server-netty/1.2.0/c30ea7f287343d3007a0794dbfeb3f69aad76ca8/ktor-server-netty-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-html-builder/1.2.0/53ef376dc21a1f404a5154096708fc104092ec77/ktor-html-builder-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-server-host-common/1.2.0/a4335b06f785b39d976e70a00a988bd077beacd1/ktor-server-host-common-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-server-core/1.2.0/4ba64df7deeb3b3cc81b66f005962edfaf63e554/ktor-server-core-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains/kotlin-css-jvm/1.0.0-pre.31-kotlin-1.2.41/718c1d40ec10699ee0ab086e2e9d4d1ebe95646d/kotlin-css-jvm-1.0.0-pre.31-kotlin-1.2.41.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-jetty/1.2.0/3dd4fd4541dd7c85564c65162117a2dd60933f0b/ktor-client-jetty-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-core-jvm/1.2.0/f88e71cffbb49bdba1f1e93131cdee2e2bae0eaa/ktor-client-core-jvm-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-http-cio-jvm/1.2.0/d37a4df9617f49378780554421a3744ab5ceb1d9/ktor-http-cio-jvm-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-http-jvm/1.2.0/aab3e7e34ba1c1947fe362f899d308d97622cfb8/ktor-http-jvm-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-network/1.2.0/bbaefc8c4d66d3707b0a247a341a2f3ea7bd0c5/ktor-network-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-utils-jvm/1.2.0/9d79aff946644c0f489e75f315fcb396f5b4581e/ktor-utils-jvm-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.31/21edc5a6b2e39bc4dc2860346fd778e27503d6cb/kotlin-stdlib-jdk8-1.3.31.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.1/706a8b8206ead3683ec639dd270d11fd948fbb0e/logback-classic-1.2.1.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-client-core/1.2.0/5788736ce2795078281e5eeb4523e0c81cf8d06/ktor-client-core-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.31/e652770b6416c6d85934086899ffed3eccd35813/kotlin-stdlib-jdk7-1.3.31.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.31/5a426a5ada97967ca60fba495eeaa66cfa7c9e2f/kotlin-reflect-1.3.31.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-io-jvm/0.1.8/591b0489ce565c32d4874610ef64c948e6a5c627/kotlinx-coroutines-io-jvm-0.1.8.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-io-jvm/0.1.8/595d4772d0600272bac6a2dcec2646b037285863/kotlinx-io-jvm-0.1.8.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-html-jvm/0.6.12/95dfe9d85947c8dd57c16dced385a37280166e56/kotlinx-html-jvm-0.6.12.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-jdk8/1.2.1/4d891cee198626c08ac30028afdd743558507ad9/kotlinx-coroutines-jdk8-1.2.1.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.2.1/3839faf625f4197acaeceeb6da000f011a2acb49/kotlinx-coroutines-core-1.2.1.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.31/11289d20fd95ae219333f3456072be9f081c30cc/kotlin-stdlib-1.3.31.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-http-cio/1.2.0/9dc1ab0d309da3a03b4e4435b9dc52afbc78c580/ktor-http-cio-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-http/1.2.0/c160a65dea5200650efd8db738fa157d8e7c3f8/ktor-http-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-utils/1.2.0/67edd57c63978974769e6ab6792713d9253c1db9/ktor-utils-1.2.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu/0.12.6/2840b58706d9ef8df7c8aee2e8b6e1444d09df60/atomicfu-0.12.6.jar:/Users/NOTiFY/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/com.typesafe/config/1.3.1/2cf7a6cc79732e3bdf1647d7404279900ca63eb0/config-1.3.1.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http2/4.1.24.Final/c0c0d9d20402e4493083447052b59d5680e88b2e/netty-codec-http2-4.1.24.Final.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-alpn-openjdk8-client/9.4.15.v20190215/d46fbf9d9c37f75e621a30bf8a192fe2ade30963/jetty-alpn-openjdk8-client-9.4.15.v20190215.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.alpn/alpn-api/1.1.3.v20160715/a1bf3a937f91b4c953acd13e8c9552347adc2198/alpn-api-1.1.3.v20160715.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.1/378913dfc3c6c71e7e2a2853eff2c3e8ac27599/logback-core-1.2.1.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains/kotlin-css/1.0.0-pre.31-kotlin-1.2.41/c40316f81304348a9983ce15a53c81130b16b36a/kotlin-css-1.0.0-pre.31-kotlin-1.2.41.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-io/0.1.8/ab4c5ab04fe13e78ab0d55d71909b22b6f52f658/kotlinx-coroutines-io-0.1.8.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-common/1.2.1/5806e3dd5e8dff59fec96747795353f3ba2bfd60/kotlinx-coroutines-core-common-1.2.1.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-io/0.1.8/59bcca58d0dae17790c96a775664267ff8492356/kotlinx-io-0.1.8.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.31/20c34a04ea25cb1ef0139598bd67c764562cb170/kotlin-stdlib-common-1.3.31.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.http2/http2-client/9.4.15.v20190215/dea5744484dbb7e192b6eb061e46d3e53a7edd95/http2-client-9.4.15.v20190215.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-alpn-java-client/9.4.15.v20190215/9e513ee27c5ea1fa4d97186e46f613b44e3a7795/jetty-alpn-java-client-9.4.15.v20190215.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-common/0.12.3/b09ed1e1b1a0996e0a3b6c454797d44788a21747/atomicfu-common-0.12.3.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http/4.1.24.Final/8f20009953b2c7c3d860cef928007bc01aa58ac/netty-codec-http-4.1.24.Final.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler/4.1.24.Final/bad56e7da211c5ebe031ae155cb648b1065c7bb6/netty-handler-4.1.24.Final.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.http2/http2-common/9.4.15.v20190215/8983928afb3064fe41b449cabcb827c1024dfba/http2-common-9.4.15.v20190215.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty/jetty-alpn-client/9.4.15.v20190215/1b215197407fdf8582711e32b187ce458c6097d9/jetty-alpn-client-9.4.15.v20190215.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec/4.1.24.Final/290857e5103956bbda11836e33245f2439226b77/netty-codec-4.1.24.Final.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport/4.1.24.Final/d37292c94d3a4cba48d9b6cfb6e8e55282035d0d/netty-transport-4.1.24.Final.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.netty/netty-buffer/4.1.24.Final/e354bed2e60b568307138e403f55ba241c1c16d2/netty-buffer-4.1.24.Final.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/org.eclipse.jetty.http2/http2-hpack/9.4.15.v20190215/1a2b990e51ea38fb742f7cdec24064c32596edb8/http2-hpack-9.4.15.v20190215.jar:/Users/NOTiFY/.m2/repository/org/eclipse/jetty/jetty-http/9.4.15.v20190215/jetty-http-9.4.15.v20190215.jar:/Users/NOTiFY/.m2/repository/org/eclipse/jetty/jetty-io/9.4.15.v20190215/jetty-io-9.4.15.v20190215.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.netty/netty-resolver/4.1.24.Final/dbc1e5b50d31aed883ea3beeb6489e1977d0687f/netty-resolver-4.1.24.Final.jar:/Users/NOTiFY/.gradle/caches/modules-2/files-2.1/io.netty/netty-common/4.1.24.Final/7eeecd7906543214c3c1c984d275d3c6de10b99d/netty-common-4.1.24.Final.jar:/Users/NOTiFY/.m2/repository/org/eclipse/jetty/jetty-util/9.4.15.v20190215/jetty-util-9.4.15.v20190215.jar com.example.ApplicationKt
2019-05-22 08:08:07.394 [main] TRACE Application - {
# application.conf # file:/Users/NOTiFY/IdeaProjects/HelloKtorWorld/out/production/resources/application.conf: 6
"application" : {
# application.conf # file:/Users/NOTiFY/IdeaProjects/HelloKtorWorld/out/production/resources/application.conf: 7
"modules" : [
# application.conf # file:/Users/NOTiFY/IdeaProjects/HelloKtorWorld/out/production/resources/application.conf: 7
"com.example.ApplicationKt.module"
]
},
# application.conf # file:/Users/NOTiFY/IdeaProjects/HelloKtorWorld/out/production/resources/application.conf: 2
"deployment" : {
# application.conf # file:/Users/NOTiFY/IdeaProjects/HelloKtorWorld/out/production/resources/application.conf: 3
"port" : 8080
},
# Content hidden
"security" : "***"
}
2019-05-22 08:08:07.885 [main] INFO Application - No ktor.deployment.watch patterns specified, automatic reload is not active
Exception in thread "main" java.lang.ClassNotFoundException: Module function cannot be found for the fully qualified name 'com.example.ApplicationKt.module'
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.executeModuleFunction(ApplicationEngineEnvironmentReloading.kt:367)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.access$executeModuleFunction(ApplicationEngineEnvironmentReloading.kt:33)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$instantiateAndConfigureApplication$1$$special$$inlined$forEach$lambda$1.invoke(ApplicationEngineEnvironmentReloading.kt:287)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$instantiateAndConfigureApplication$1$$special$$inlined$forEach$lambda$1.invoke(ApplicationEngineEnvironmentReloading.kt:33)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.avoidingDoubleStartupFor(ApplicationEngineEnvironmentReloading.kt:320)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.access$avoidingDoubleStartupFor(ApplicationEngineEnvironmentReloading.kt:33)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$instantiateAndConfigureApplication$1.invoke(ApplicationEngineEnvironmentReloading.kt:286)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading$instantiateAndConfigureApplication$1.invoke(ApplicationEngineEnvironmentReloading.kt:33)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.avoidingDoubleStartup(ApplicationEngineEnvironmentReloading.kt:302)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.instantiateAndConfigureApplication(ApplicationEngineEnvironmentReloading.kt:284)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.createApplication(ApplicationEngineEnvironmentReloading.kt:137)
at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.start(ApplicationEngineEnvironmentReloading.kt:257)
at io.ktor.server.netty.NettyApplicationEngine.start(NettyApplicationEngine.kt:116)
at io.ktor.server.netty.NettyApplicationEngine.start(NettyApplicationEngine.kt:22)
at io.ktor.server.engine.ApplicationEngine$DefaultImpls.start$default(ApplicationEngine.kt:56)
at io.ktor.server.netty.EngineMain.main(EngineMain.kt:21)
at com.example.ApplicationKt.main(Application.kt:14)
Process finished with exit code 1
Any suggestions, besides look at your stack trace it's a:
java.lang.ClassNotFoundException: Module function cannot be found for the fully qualified name 'com.example.ApplicationKt.module' ?
I ran into same issue. Above mentioned suggestion of changing flag value or deleting file, didn't worked for me.
Root cause of problem, observed in application.conf
Before
modules = [ ApplicationKt.module ]
After
modules = [ com.exp.ApplicationKt.module ]
The full path of Applicationkt.module was changed while relocating files in process of structuring classes by movement[in my case].
The problem is with argument testing: Boolean = false in function Application.module. It looks like that io.ktor.server.engine.ApplicationEngineEnvironmentReloading.executeModuleFunction doesn't play well if module has argument(s). Or arguments have to be declared somehow in application.conf file, but this doesn't make sense since it already has default false value. Or we are not building the project correctly.
Just remove the argument from the function, the annotations and delete the ApplicationTest.kt from test folder and you'll good to go.
I had the same problem. It because Kotlin compile Application.kt to ApplicationKt.class (the postfix was added). That's why I need to add Kt postfix to my conf.
modules = [ me.dehasi.httpapi.ApplicationKt.module ]
But the filename is just Application, without Kt.
I came here due to having the exact same error and I'm just trying to learn more about this.
If I remove the parameter to the module, so it looks like this:
#Suppress("unused") // Referenced in application.conf
fun Application.module() {
val client = HttpClient(Apache) {
}
Then it start without any complaints.
Why it works, no idea yet!
Edit:
I used the plugin to setup the project and I'm on java 1.8 (though I don't think it matters here)
Edit 2:
This was how the code was generated for me:
#Suppress("unused") // Referenced in application.conf
#kotlin.jvm.JvmOverloads
fun Application.module(testing: Boolean = false) {
val client = HttpClient(Apache) {
}
there is another solution besides removing the default argument:
add package name on the top of Application.kt, it works for me.
my ktor version is 1.2.2
In my case, I updated my project package but forgot to do the same in application.conf file which returned this error.
Please double check this too.
fun Application.module() should not have parameters
And the definition of the module has to have as a prefix your package and path from source root.
application { modules = [ com.package.app.ApplicationKt.module ] }

How to make a Gofer load to be in the baseline of a ConfigurationOfMyProject?

I can successfully load this project into Pharo 5
Gofer it
url: 'http://seaside.gemtalksystems.com/ss/MockGemStone';
configurationOf: 'MockGemStone';
load.
#ConfigurationOfMockGemStone asClass load.
But I'd like to use it as dependency on another project that has its own ConfigurationOfMyProject to load (which later is used by the CI in images builds).
What I've tried is to put this on the baseline
baseline11: spec
<version: '1.1-baseline'>
spec for: #'pharo5.x' do: [
self class ensureGitFileTree.
spec blessing: #baseline.
spec project: 'MockGemStone' with: [
spec
package: 'ConfigurationOfMockGemStone';
versionString: #stable;
repository: 'http://seaside.gemtalksystems.com/ss/MockGemStone'.
].
But that brings many validation errors like "Error: symbolic version #stable does not resolve to a literal version. { cannotResolveVersion } [ #validatePragmas ]"
How should I "translate" the Gofer load into the spec setup? Or where can I see documentation about how that's done? Thanks!
I think you need to replace #package: with #className:, i.e.:
spec project: 'MockGemStone' with: [
spec
className: 'ConfigurationOfMockGemStone';
versionString: #stable;
repository: 'http://seaside.gemtalksystems.com/ss/MockGemStone'.
].

Behat 2.4 upgrade issues, or Unrecognized options "extensions" under "behat" - error when attempting to activate sahi extension via behat.yml

Fairly new to this Behat stuff, and I've run into a roadblock I can't seem to get around. I've been staring at the docs, googling like it's my job, and doing my best to refrain from tossing my computer off the fire escape.
I'm working with a fairly complex project, and I'm not the one who set it up. So I'm a little lost in some areas.
Currently, I'm trying to use the Sahi driver, because selenium isn't cutting it for some dynamic forms I need to test. I can run the tests fine with the default selenium driver, but the tests fail because it doesn't adequately trigger JavaScript events on form input. Specifically, it'll work with the workarounds covered in that link, but only if I have the browser in focus. Which means it fails when the tests are run in sauce or via jenkins with xvfb.
I'm explaining all this only because this is my larger issue, which I'm attempting to address by using the Sahi driver. Which brings me to:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "extensions" under "behat"
That's what I get when I try to activate the Sahi driver for a particular profile in my bahat.yml the way the documentation says to.
Here's the default profile and the profile I'm currently working with in my behat.yml (slightly modifies for public consumption):
default:
paths:
features: 'features'
bootstrap: '%behat.paths.features%/bootstrap'
sahi:
extensions:
Behat\MinkExtension\Extension:
sahi: ~
context:
class: 'FeatureContext'
parameters:
environment: 'staging'
mink: 'sahi'
Fwiw, the tests are on a vm, which I ssh -X into, then run the test using
$ behat --tags #test_name_tag --profile=sahi
When I'm using the default selenium driver and the #javascript tag, the browser pops up and the tests run and pass (assuming I keep the browser in focus, of course).
I installed the additional drivers using composer:
{
"require": {
"behat/behat": "2.4.*#stable",
"behat/mink": "1.4#stable",
"behat/mink-extension": "*",
"behat/mink-selenium2-driver": "*",
"behat/mink-sahi-driver": "*"
}
}
I've added use Behat\Mink\Driver\SahiDriver; to my MinkContext.php, EnvironmentContext.php and FeatureContext.php, though I'm guessing that's probably either overkill or not necessary. It doesn't seem to be making a difference at this point, though. I get the same error with or without it.
I also added a sahi.php which lives in features/bootstrap/mink:
<?php
return
array(
'default_session' => 'sahi',
'sahi' => array(
'capabilities' => array(
'browserName' => 'firefox',
'browserVersion' => 7,
),
),
);
I thought maybe adding a directory in features/bootstrap called exensions might help for some reason. Even stuck a file in there called sahi.php. That didn't help much.
I think that covers everything. Thanks in advance for any help, and if this is covered elsewhere, please direct me to it, because I've spent countless hours looking and haven't found anything that helps me.
Update:
I uninstalled the old versions of behat, mink and gherkin, and installed 2.4, et al as per this https://lestbddphp.wordpress.com/2012/08/31/behatcomposer/
I've been making my way through "Migrating from Behat 2.3 to 2.4" in the docs. (Sorry, SO won't let me post any more links, but it's in the official Behat docs.)
My composer.json:
{
"require": {
"behat/behat": "2.4.*#stable",
"behat/mink": "1.4#stable",
"behat/mink-goutte-driver": "*",
"behat/symfony2-extension": "*",
"symfony/class-loader": "2.1.*",
"symfony/form": "2.1.*",
"symfony/validator": "2.1.*",
"behat/mink-selenium-driver": "*",
"behat/mink-selenium2-driver": "*",
"behat/mink-extension": "*",
"behat/mink-sahi-driver": "*"
},
"minimum-stability": "dev",
"config": {
"bin-dir": "bin/"
}
}
I moved my behat.yml file to the root of the project, as directed. I updated my default profile to:
default:
paths:
features: 'features'
bootstrap: '%behat.paths.features%/bootstrap'
extensions:
Behat\Symfony2Extension\Extension:
mink_driver: true
kernel:
env: test
debug: true
Behat\MinkExtension\Extension:
default_session: symfony2
sahi: ~
though I'm not entirely sure that's what I need. Just going by the example given in the docs.
I updated my vendor/autoload.php by replacing the require_once with require:
<?php
// autoload.php generated by Composer
require __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit::getLoader();
but I'm a little confused by this, because that file is different from the example code in the docs. If I were to add the line in the docs here, instead of what was already there, then it would just be loading itself. (I tried. It barfed.) Am I completely dense, or is the wording here confusing/misleading? Did I do this correctly?
As I mentioned before, I have 3 context files in features/bootstrap:
FeatureContext.php
EnvironmentContext.php
MinkContext.php
When running the tests via cli, I pass it a --profile, and then it uses the appropriate profile in behat.yml. In almost all of the profiles, FeatureContext is used.
context:
class: 'FeatureContext'
FeatureContext then gets EnvironmentContext and MinkContext, from what I can tell. So, theoretically, everything should be working there.
Only it's not.
$ bin/behat --profile=sahi
[ReflectionException]
Class AppKernel does not exist
Before I added all the Symfony stuff, I was getting this:
Warning: require(Behat\Symfony2Extension\Extension): failed to open stream: No such file or directory in /path/to/project/vendor/behat/behat/src/Behat/Behat/Extension/ExtensionManager.php on line 112
Fatal error: require(): Failed opening required 'Behat\Symfony2Extension\Extension' (include_path='/usr/share/pear:/usr/share/php:/usr/share/git core/templates/hooks:.') in /path/to/project/vendor/behat/behat/src/Behat/Behat/Extension/ExtensionManager.php on line 112
Which is why I added the Symfony stuff via composer.
Also possibly of note: when I forgot to pass it a --profile, before installing the Symfony stuff via composer, I got this:
Notice: Undefined index: environment in /home/lbaron/development/BeHat-Functional/features/bootstrap/FeatureContext.php on line 43
Warning: include(/path/to/project/features/bootstrap/environment/.php): failed to open stream: No such file or directory in /path/to/project/features/bootstrap/FeatureContext.php on line 44
Warning: include(): Failed opening '/path/to/project/features/bootstrap/environment/.php' for inclusion (include_path='/usr/share/pear:/usr/share/php:/usr/share/git-core/templates/hooks:.') in /path/to/project/features/bootstrap/FeatureContext.php on line 44
Catchable fatal error: Argument 1 passed to EnvironmentContext::__construct() must be an array, boolean given, called in /path/to/project/features/bootstrap/FeatureContext.php on line 44 and defined in /path/to/project/features/bootstrap/EnvironmentContext.php on line 27
Which I guess is to be expected.
So I'm at a loss now. Ideas?
I'm going to keep banging on it to see if I can figure it out, but any ideas/input would be greatly appreciated.
Update again:
Removing the extensions section from yml gives me this:
Catchable fatal error: Argument 2 passed to Symfony\Component\BrowserKit\Client::__construct() must be an instance of Symfony\Component\BrowserKit\History, array given, called in /usr/share/pear/mink/src/Behat/Mink/Behat/Context/MinkContext.php on line 163 and defined in /home/lbaron/development/BeHat-Functional/vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Client.php on line 52
Current state of behat.yml:
default:
paths:
features: 'features'
bootstrap: '%behat.paths.features%/bootstrap'
formatter:
parameters:
language: 'en'
extensions:
Behat\MinkExtension\Extension:
sahi: ~
goutte: ~
You are running a version of behat which is older that 2.4 (the current version). I can tell because the command you use is "behat" instead of "bin/behat". Older versions had a different architecture and did not use extensions. The documentation on the behat.org website is all for the new 2.4 version and, as far as I know, does not have the documentation for older versions available anymore. You should upgrade your behat version to 2.4, there is a guide on how to do this here