Closed maxtar closed 9 years ago
The name of the collection can be modified by extending the MongoDBFormatter and overwriting at.porscheinformatik.cucumber.formatter.MongoDbFormatter#getCollection
. The default implementation just returns "collection_version". By overriding the getCollection
method you could return something like "MyProductA_1.0.0" as well. This is, at least, how we currently set the collection names, because we get them from our system under test.
But what do you think about changing the default implementation to check a system property for the collection-name?
The menu "products" just links to a filtered list of the collections. But I thought about either removing it or retrieving it dynamically from the DB. But ATM I'd rather remove it since it doesn't provide that much additional functionality.
Collection name from system properties - ok. Fine variant. Products name will be cool to get from database. :)
Can you do that instead list of features will list of runs. What if I want run few tests from different features?
When you click on a collection on the home-screen you will come to a list of runs. Here you can see a list of four runs (two runs only run the "Basic Arithmetic" feature, one run contains the "Basic Arithmetic Two" feature and one run contains both features.
Thanx, Klaus. Will try with run by JUnit.
@maxtar the products should be loaded via the database. Could you give it a try?
@klausbayrhammer Sorry for long answer. We are having NewYear holidays till 12 of Jan. I'll try when return to work. :)
@klausbayrhammer hi. I added -Dcucumber.report.collection.name=project to JVM arguments, but nothing changed. I have only one product - "collection".
@maxtar The name of the collection specified by cucumber.report.collection.name
has to be in the form productname_version (the underscore is necessary). In commit c96b4c290bb47d44443b18d4a762051b8d36e29e I've added specific system properties for the product name cucumber.report.product.name
and product version cucumber.report.product.version
.
Now you can specify the name of the collection via
-Dcucumber.report.collection.name=productA_1.2.0
-> results in collectionname productA_1.2.0-Dcucumber.report.product.name=product -Dcucumber.report.product.version=1.2.3-SNAPSHOT
-> results in collectionname product_1.2.3-SNAPSHOT-Dcucumber.report.product.name=product
-> (with version default 1.0) results in collectionname product_1.0@klausbayrhammer Sorry, I don't understand. I have set following settings: -Dcucumber.report.product.name=Boor -Dcucumber.report.product.version=MySNAPSHOT -Dcucumber.report.collection.name=FF But in web-interface I see only "Product / Version Statistics collection_version Charts"
You have to set the properties for the process you use for your cucumber-tests with the MongoDBFormatter.Like java -cp ..... cucumber.api.cli.Main -f at.porscheinformatik.cucumber.formatter.MongoDbFormatter -Dcucumber.report.collection.name=productA_1.2.0 myFeature.feature
The idea behind this was to have a single web-application which stores all test-results from different products and versions. When you execute your cucumber-tests each test-run knows what product and version is tested and publishes the information to the web-application. So one test-run only tests one product/version but the webapp stores information on test-runs of different products and versions.
Hope to help
Yes, i have following run string "java -Dcucumber.report.server.baseUrl=http://localhost:8080 -Dcucumber.report.product.name=Boor -Dcucumber.report.product.version=MySNAPSHOT -Dcucumber.report.collection.name=FF -Dfile.encoding=UTF-8 -classpath ... cucumber.api.cli.Main --format at.porscheinformatik.cucumber.formatter.MongoDbFormatter --monochrome --glue ... My.feature"
Hm that looks correct. In the webapp you should have a couple of logs like 08:52:40.662 [http-nio-8081-exec-2] INFO a.p.c.m.r.c.CucumberPluginController - insert report into collection Boor_MySNAPSHOT
Is the collection name in the logs correct? And can you see the data of the new testrun in the webapp?
No, I see only strings like this: "18:28:19.664 [http-nio-8080-exec-8] INFO a.p.c.m.r.c.CucumberPluginController - insert report into collection collection_version 19:40:58.062 [http-nio-8080-exec-9] INFO a.p.c.m.r.c.CucumberPluginController - insert report into collection collection_version 19:44:46.530 [http-nio-8080-exec-10] INFO a.p.c.m.r.c.CucumberPluginController - insert report into collection collection_version"
Is it possible, that you use an older version of the formatter? In c96b4c290bb47d44443b18d4a762051b8d36e29e I've changed the fallback collectionname from "collection_version" to "product_version". So in the current version of the formatter you should see a log like INFO a.p.c.m.r.c.CucumberPluginController - insert report into collection product_version
Strange. I've got last version yesterday. Will try one more time.
Sorry. I got it! You have changed version, but I didn't notice these. And didn't change in my pom dependencies. All OK, except I doesn't see collection name from cucumber.report.collection.name property
Sorry for the version-change.
The collection-name has to be in the form product_version - the underscore is necessary. Like -Dcucumber.report.collection.name=FF_mySnapshot
Otherwise the data is filtered and not shown in the webapp.
Ok. have changed to F_F. Nothing changed.
Hm. Do you have a log-entry INFO a.p.c.m.r.c.CucumberPluginController - insert report into collection F_F
? Can you see the results of that test-run unter the "collection_version" or "product_version" product?
No, I haven't. Just "12:13:12.730 [http-nio-8080-exec-9] INFO a.p.c.m.r.c.CucumberPluginController - insert report into collection Boor_MySNAPSHOT 12:30:00.902 [http-nio-8080-exec-4] INFO a.p.c.m.r.c.CucumberPluginController - insert report into collection Boor_MySNAPSHOT
Hm and you don't see an entry Boor_MySNAPSHOT on the product overview or the entry "Boor" in the product dropdown on the menu?
When you start with -Dcucumber.report.product.name=Boor -Dcucumber.report.product.version=MySNAPSHOT -Dcucumber.report.collection.name=FF
the collection name is a combination of product.name and product.version. If you start with -Dcucumber.report.collection.name=F_F
the collection-name is F_F.
Do you have any exceptions/stacktraces in the webapp-log?
Yes. I have "Boor" product in dropdown list. I haven't any exceptions. Am I properly understand that I need set or -cucumber.report.product.name, cucumber.report.product.version or just only cucumber.report.collection.name properties?
Yes exactly. You can either specify:
Iv'e got it, Klaus. I think will be better to add this description to the documentation. :)
Glad to hear! You're right all these things should go in the documentation. I'll update the docs tomorrow!
Can I somehow add my project to the products list? Now they are hardcoded. And I want rename "collection_version" to another name.