Should I use pact based stub service or Wiremock.net? - testing

I am researching tools for Component Testing for Microservices in the dotnetcore world.
Along with Component Testing I am planning to do Contract Testing as well using Pact.net.
While reading Pact.net here:
https://github.com/pact-foundation/pact-net
I found link to:
https://github.com/seek-oss/seek.automation.stub
which says its a Pact based stubbing library for .NET.
This makes lot of sense to use since I am going to use Pact and my Pacts can be used for stubbing.
But before this I was considering WireMock.net https://github.com/WireMock-Net/WireMock.Net. Has anyone tried each and share their feedback which one I should pick? WireMock seems to be very popular in community compared to this Seek Automation stub.
Thanks for your help in advance!

You could ask this on the Pact gitter channel https://gitter.im/realestate-com-au/pact

Related

Best practices writing Espresso tests for a multi modular Android projects (MVI/MVVM)

I am looking into Espresso Framework to adopt the best practices for writing tests for a multi modular Android projects (MVI/MVVM).
Is it a good idea to cover/write all the Espresso tests inside the app module (or) it needs to be isolated specific to each modules?
Is there any other best practices for MVI/MVVM based Android projects? if so, please comment and provide references if any
Language used: Kotlin
I have recently been implementing espresso tests in the multi-modular project where I work. Through some research and help from senior developers, I think I will be able to guide you a bit in the proper direction.
For the first question, Yes, it's essential that all the tests related to a particular activity remain in their corresponding 'test' class. That keeps it modular and easy to debug. So, one should make a test class for a particular activity and that should be in the corresponding module that the 'activity' belongs.
All these test classes can then help you to build a 'TestSuite' which could be used to make a flow for testing the app's specific features. In a test suite, one needs to mention those classes that make that flow.
After all this research and as per knowledge, I guess, this approach is good enough for large projects as well since the app I am working on is really big.
Blocker :
In a multi-modular project, I am still not able to create the test suite since I am not able to import those test classes in the main app module. But this issue will be fixed very soon. I'll definitely update it here when I'll get the method to do so.
Please do comment, if I am doing something wrong. Suggestions are a warm welcome.

CORDA Development

I need to implement CORDA Block Chain in our performance appraisal application which is developed in .Net Core and angular. Please guide us the structure and how to use it.
Your reply is really appreciated.
Thanks,
Kopal Rajpoot
So there's not a very clear question here, but if you're looking to get started with corda, here are some good links.
I'd recommend starting with the cordapp tutorial.
https://docs.corda.net/docs/corda-os/4.7/quickstart-deploy.html#running-the-example-cordapp
corda documentation : https://docs.corda.net
corda source code : https://github.com/corda/corda
R3 developer slack : slack.corda.net we try to be very responsive there.
good luck!

Does Karate DSL Framework has the capability of performing load testing

Currently, we've automated all of our web services using the Karate framework and it is super cool.Is there any way we can do the load testing with this tool?
Example: Given when I enroll a member 1000 times
Then the average response time should be 2.7 milliseconds
I'm the developer of Karate and it is great to hear this feedback, thanks !
Karate was not designed for load-testing - but we would like to support it in the future. But it is not a priority now, and there are things like mocking we want to get to sooner which we feel is a more critical need for many teams.
If you or the community would be willing to investigate and contribute, that would be great. One experiment I can think of is using the Java API try to create multiple threads and run a *.feature file.
EDIT: Karate now has Gatling integration: https://github.com/ptrthomas/karate-gatling-demo
Yesterday as part of my POC work w.r.t API demonstrated Karate in my office people were very much impressed. thanks for Karate team.

what is swagger exactly ? And why doesn't the online editor run requests?

I've spent the last few days trying to understand if I should use api blueprint, RAML or swagger.
It looks like swagger has the biggest community but the closer I look the more I feel that it greatly lacks in documentation (I was forced to look at the code many times to try and integrate it with my current project), many github issues and stackoverflow questions are unanswered.
Is it possible that I am missing something here?
All I want is a tool to help me write the API documentation and test the endpoints.
Why must swagger become part of the server logic?? If I create swagger files in the editor and then serve them to the UI directly it breaks..
As far as I can tell it even makes the server slightly slower and forces the existence of many clumsily maintained integrations :p What am I missing here?
We're trying to work a lot on improving the documentation of Swagger. It's a bit more difficult when many of the projects are community-driven and not managed by a single organization.
We actually try to reply to issues on github quickly (we don't always succeed) and we have our own google group for general questions so we follow stackoverflow somewhat less.
The editor you mention is a new tool as part of the work on Swagger 2.0 and it's not final yet. As such, it still have a few bugs and missing features. The UI is also in the process of being adapted to Swagger 2.0 and the same limitations apply to it.
You most certainly don't have to integrate it with your server and you can expose the documentation statically. The advantage of integrating it with the server is that it's easier to maintain if the API changes.
You can try RAML + ramlev + Abao
The steps should be
Write API Spec in RAML with your fav editor, ie. Atom, vim
Validate your RAML with ramlev
Implement the server logic according API Spec
Validate server logic with Abao

What is the best testing framework to use with Node.js? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have looked at the rather long list of testing frameworks at https://github.com/ry/node/wiki/modules#testing. What is the experience with these frameworks?
Obviously the ability to run in the browser would be a big bonus, but I'm mainly interested in Node.js. Something with a heavily asynchronous slant would be great.
Update:
Mocha is the best in my opinion.
What is the experience with these frameworks?
I played with expresso which is pretty cool testing framework which also has test-coverage. It has been created by TJ Holowaychuk who is also the creator of Express.js (insanely fast (and small) server-side JavaScript web development framework built on Node.js and Connect). I recently saw that he also has a cool library called should.js which can be used together with Expresso for a even better testing experience.
Obviously, the ability to run in the
browser would be a big bonus
I don't believe it can run in the browser, but I also don't get why you would want to run it inside the browser?
but I'm mainly interested in Node.js.
Something with a heavily asynchronous
slant would be great.
Quote from the expresso:
The argument passed to each callback
is beforeExit, which is typically used
to assert that callbacks have been
invoked.
You can use beforeExit to test asynchronous functions.
TIP: Follow TJ Holowaychuk on GitHub, because he creates very good open-source code.
I use VowsJS which is easy to use async BDD framework (Behaviour Driven Development) and get the job done.
From what I see lately it's what many chose to test their NPM modules, so I believe so far it's one the best to use.
Some popular testing frameworks that could be used with NodeJS are also those:
Mocha
Jasmine
Expresso (no longer maintained)
Should
NodeUnit
jsUnit
You can also see a list of JavaScript test frameworks here
Few more libs that could help you write better code are those:
ReadyJS watches your js files and test them with JSHint
Concrete small continuous integration server
Jezebel continuous testing for Jasmine
Nosey not quite there but have a nice roadmap so I keep an eye on it
There is also Bamboo CI Server by Atlassian it automates builds and tests. It is a package for Apache/Tomcat (which sux because it uses Java and that makes it very heavy) also is not free but it has a starter license which costs $10 so I believe it is affordable. It is the most featured of all CI servers I found so far and it supports all unit tests that support xUnit that means that you can run builds/tests for any language with Bamboo.
Another option for CI with NodeJS is Travis which lot of people use for their open source projects, as it says A hosted continuous integration service for the open source community.
There is also a google group discussion with Continuous Integration for Node JS Projects topic.
Based on the asker's comments above, I tried out vows, and it solved a lot of problems I was having with my async testing. Its ability to mix serial and parallel testing is awesome.
Make sure you read the guidance doc carefully, but once you get the hang of it, it's flexible, powerful, and produces nice, clean results.
UPDATE: I would also encourage people to check out should for their asserts. It allows for very flexible, very readable asserts, and is compatible with both Expresso and Vows, and probably most other test frameworks as well.
(I'm posting this as a separate answer just in case people don't notice the comments on Alfred's answer.)
UPDATE 1/7/2015: For what it's worth, I have since switched from Vows to Mocha, and from Should to Chai. Mocha has much better support now for asynchronous tests using promises, and Chai allows for several flexible assert options, including the expect api, for those who don't like to modify the object prototype.
I've started using Jasmine for my JavaScript testing specifically because it's small and runs in both the browser and node. It's also got a really solid reporting and matcher API so it's easy to integrate with other tools in the future. Having a buildin mocking framework is also useful since it's often one of the first things I would add when I was using qunit for TDD in the browser.
If you want a true BDD framework then maybe consider Yadda. It integrates with mocha, jasmine, nodeunit, qunit, zombie and casperjs, to support feature files, e.g.
Scenario: provides the version of all services
given service x is running
and service y is running
when I request the service versions
then service x should be version 0.0.1
and service y should be version 0.0.2
I've been using nodeunit and its ability to work with async functions is reasonably straightforward.
There's a nice walkthrough that should get you ready-to-go with nodeunit on his blog.
[ Note: the API has changed since the blogpost – setUp(callback) and tearDown(callback) both take a callback as an argument, which you need to call when your setup/teardown is complete. ]