Golang Delve: Drop into debugger when unit test fails - unit-testing

I'm trying to have Delve drop into a debugger when a test from the testing package fails. How can I do this?
For reference, I'm looking for functionality similar to nose, pytest, or other python testing packages. Using nose, I can do
nosetests test_things.py --pdb
which would let me trop into a debugger when any unit tests fail.

Related

How does a test-framework like Mocha run tests without a runner like Karma?

From what I understand about testing in Javascript, test runners like Karma are used to run the tests written in test frameworks like Mocha.
Now, my question is, how do tests execute when I input a command like mocha in my npm project without having Karma?
Is my understanding of these testing terms faulty or is there something that I am missing here?
Note: I have read that Karma is used to run tests on various browsers as well as various devices. But then how is Mocha different from it? Is it just that Mocha's output is on the terminal while Karma outputs on the browser??

Are there any ways to run F# unit tests in interactive mode?

Without an IDE integration, running F# unit tests is pretty cumbersome.
One needs to compile them and then pass the resulting dll to a test runner.
I want to find an easier way to run the kind of tests you find for problems on http://exercism.io/
Any ideas?

How to unit test in ScriptSharp

We noticed that there was a unit testing project within the latest Script# 0.8 code on the Git repository, but there is no documentation as to how to actually use it, and the example files don't seem to work correctly.
Having stepped through the source code, we can't actually see any test code within the unit test files.
Has anyone else managed to successfully run unit tests against Script# within the Visual Studio IDE?
The AroundMe sample at https://github.com/nikhilk/scriptsharp/tree/cc/samples/AroundMe demonstrates unit testing.
In short, there are two parts -
1. The Tests subnamespace within your project containing tests alongside code being tested. Test code gets split out by the compiler to generate a Foo.test.js alongside Foo.js and Foo.debug.js.
A test project which provides a driver to launch unit tests in browser and capture results of QUnit to surface into VS unit testing UI. This is optional... you could run the Foo.test.js manually using QUnit yourself if you've got your own pipeline for executing tests.
Hope that helps.

Eclipse with Django Unittest

I have a simple set of Django test cases that fail in Eclipse. Specifically if I have something like:
resp =self.client.get('/accounts/newUser/')
self.assertEqual(resp.status_code,200)
self.assertTrue('user' in resp.context)
then it would fail because resp.context is None. I have managed to get to run from eclipse using django.test.utils.setup_test_environment(), but then I have have to do something like resp.context[0][0][0]['user'] which is less than ideal.
Is there a more clever way to get python unit tests to run from Eclipse? I've seen this solution using django-nose from eclipse and my original solution above came from here.

Running VSTS tests without mstest.exe

From reasons I won't get into, all our unit tests are using the VSTS test framework. I now want to create an MSBuild script that runs the tests, but I don't want to use mstest.exe from various reasons (it's slower, requires Visual Studio installation everywhere, I need to maintain testrunconfig, etc.)
I've seen that TestDriven.net and TeamCity are able to run VSTS tests 'NUnit style', without using mstest.exe. Are you aware of any standalone command line utility that does this?
You can execute Team System Tests (MSTest) in NUnit if you use a special NUnit Addin that recognizes the MS Test Attributes (TestClass, etc).
Exact Magic Software has an open-source "test-adapter" that can do this.
UPDATE: I've reworked Exact Magic's Msts NUnit Adapter for NUnit 2.5.2.
Download here: http://snippetware.googlecode.com/files/ExactMagic.MstsAdapter.zip
Read more about it here: http://www.bryancook.net/2009/10/mstest-nunit-adapter.html
It seems like TeamCity is simply leveraging Gallio to run VS tests. Gallio appears to have msbuild integration and sounds perfect but after a closer look it seems that it would require a VS install just like MSTest as it appears to depend on MS exes:
The plugin enable condition was not satisfied: '${process:DEVENV.EXE} or
${process:VSTESTHOST.EXE} or
${process:QTAGENT.EXE} or
${process:QTAGENT32.EXE} or
${process:QTDCAGENT.EXE} or
${process:QTDCAGENT32.EXE}'.
Host process exited with code: 0
That being said it sounds like at least one person has got it working:
Christoph De Baene - Running MSTest without Visual Studio
It is possible to run MSTests without installing Visual Studio. See how-do-i-use-mstest-without-visual-studio.
I did this so that I could run my tests as part of my CI process. (I am using CC.NET for my CI solution).
I am in a similar situation as you, in that I want to use TestDriven.NET to get code coverage stats. But, I am running into problems. My first problem is that I am using AssemblyInitialize attributes to initialize a database connection. This isn't supported by NUnit so about half of my tests fail whereas they run fine under MSTest.
So, it seems that translating tests from one test framework to another has pitfalls. If you are aware of that, then go forth, but it might be better to try and keep consistent on one test framework.
We run VSTS tests using msbuild TestToolsTask on a Cruise Control server. This does not use the MSTEST executable -- the condition you ask for -- but does use a variety of TFS dependencies.
Note that we are migrating tests off of the VSTS test framework for NUnit, mostly because we can create extensions for NUnit to perform useful tasks.