WebTests in VS2012 not running - visual-studio-2012

We use VS Ultimate for web tests and load tests, but since moving to VS 2012 from VS 2010, the web tests don't seem to run anymore. We used to be able to do ctrl-r ctrl-t to debug specific tests, but that doesn't work anymore. I then found out about the issue with running tests in context, so I just tried running all tests, but that didn't work either. VS2012 is acting like it doesn't see WebTest as real tests anymore.
Even when I try to view the tests in the test explorer, nothing shows up. I know my tests are correct because I can go back in to VS 2010, and everything still works like it should.
Is anyone else having this issue?

Visual Studio 2012 dropped the "Test View" window that we used to use to run tests in VS 2010. The new "Test Explorer" window only recognizes Unit Tests and Coded UI Tests, as you've discovered. This totally threw me off too.
To run web and load tests (besides the obvious but tedious method of actually opening them and clicking "Run" in the editor window) you have to select the tests you want to run in the Solution Explorer, then Load Test (menu) > Run > Selected Test. Or alternatively "All Tests in Solution".
You also have the option of running the individual Web Tests that are contained in any open Load Test. Right-click on the Test Mix node (in Scenario) or any of the tests in the Test Mix.
For completeness here is the authoritative source: http://msdn.microsoft.com/en-us/library/ms182541.aspx
By the way, here is another gotcha: although you still choose testsettings for a Load Test from the Load Test menu, you now set the testsettings for Web Test execution separately, under the Test menu:

Related

Test events were not received in Android Studio after modifying coverage options

I had no problems before running my tests, but then I clicked on edit configuration to hide Hilt classes from code coverage and suddenly tests stopped working and this message started appearing.
I have tried everything in the related questions, but none of them seem to talk about this problem with code coverage and tests stopping running after modifying configurations. I can run tests for each package separately but if I try to right click on my unit test folder and click on run, I get the message all the time.
I am not using any test plugin or anything, just the standard Android Studio tests with Mockk and Truth as frameworks.

What does "This profiling configuration does not apply to the selected run configuration" mean in JetBrains Rider and how do you resolve it?

I'm trying to run a profiling session following the instructions, but I'm stuck on the first step where it says to pick a profiling configuration as they are all disabled with the error message "This profiling configuration does not apply to the selected run configuration".
What does this mean? What might cause it? And how might I resolve it?
Linux Mint 19, Rider 2020.1.3 installed via jetbrains toolbox, dotnet core installed via asdf-vm.
It's not a real problem, just a UI bug I think.
In toolbar, the profiling configuration drop-down menu is also a button to run the current Run/Debug Configuration. If you set the Run/Debug Configuration to a normal .NET Static Method (often Main function), the profiling configuration button is enabled again. Click it will run the Main function and profiling it normally.
But you can't use this button to profile a unit test session.
Instead, this setting is automatically applied when you click Profile selected unit test:
Just select the config you want, start the unit test, it will work.
This logic is more clear in menu. In the Run menu, third item Profile XXX Using YYY has a same icon with profiling configuration. Hover the profiling configuration button will show a tooltip contains a message equals the menu item.
And you can't run a unit test in Run menu, there is a Tests menu instead.
One more thing: Rider profiling support in Linux is incomplete, I recommend you do profiling things in Windows.

Xunit test does not run

I saw Xunit Unit Tests will not run that seems specific to VS 2017. I am having the same problem with VS 2019. I can try to run the test via the Test Explorer or run the tests by right clicking on the test. Either way the test never runs. I have tried Debug an setting a breakpoint at the first line of the test. The breakpoint never gets hit. Similaryly I have tried debugging the test from the Test Explorer. Even if I bypass debug and just run the test the result always shows as "Not Run". I am not sure why the test will not run. None of the steps for VS 2017 seem to make a difference for VS 2019. How can I get my test to run?
If you are compiling x64 there is an option to run tests with a specific platform in the test menu. Change selection from x86 to x64.

Flutter: Debugging an integration test

I'm learning Flutter and using Android Studio as my IDE and i've hit some pain points around Integration Testing.
As part of the learning process i have written a basic Integration Test.
The intention with this integration test is to examine an Image widget (created via Image.Asset) to see if the image source, which is dynamically generated, is the expected value, or that an image is being displayed.
I run the integration test using the Terminal tab in the IDE, e.g: flutter drive --target=my_app/test_driver/user_list_scrolling.dart
I want to add a breakpoint to my Integration Test method and step through it from within Android Studio to help aid my learning of the testing functions.
My questions are:
How can i debug an integration test from within Android Studio? - As I'm learning i would love to put a breakpoint in my integration test and play around with the Finders in the immediate window. However, when i start my integration test from the terminal my Breakpoints seem to be ignored, i also tried adding the Debugger(); command. Execution paused, but i was unable to step through my code in Android Studio. I've also tried using the 'Attach to process' option in the IDE but the 'Choose process' list is empty.
Can i execute an integration test from within Android Studio without having to manually enter a command into a terminal? - i would rather click a button than memorise a command. Right-clicking my integration test file and selecting run does not appear to work.
How can i effectively test an Image widget from within an Integration Test? - The image source is set by calling Image.Asset() with a calculated value as the first argument, so i want to confirm that an image is displayed / the argument is the expected value. I'm guessing i need to use find.byType("Image") and somehow examine the result for the source value?
The following are the steps I took to set-up for integration test development using Flutter tooling, including debugging:
Configure the app to listen on a shared port (in this case 8888)
Add ‘— observatory-port 8888’ to ‘Additional Arguments’
Configure integration test to connect on the same shared port
Add ‘VM_SERVICE_URL=http://127.0.0.1:8888/’ to ‘Environment Variables’
Start the app in run or debug-mode (only required once, with hot-reload when needed):
Start the integration test in run or debug mode (as many times as you want):
You can now add breakpoints to the app and/or test and view source code and variables in debugger.
The following describes how to setup Android Studio to develop integration tests in more detail.
A how-to for fast integration test development with existing tooling
For some reason in Android Studio the icon to run in debug mode doesn't work with configurations scoped to entire directories. Create a configuration targeting one file, or simply click the "Run Test" icon in the gutter next to your main() function and select the "Debug" option.
With the new integration_test package you can just run flutter run integartion_test/app_test.dart to debug your tests.
My launch.json (I'm using VS Code):
{
"version": "0.2.0",
"configurations": [
{
"name": "Integration Test",
"request": "launch",
"type": "dart",
"program": "example/integration_test/app_test.dart",
},
]
}
You can run then the integration test from the AndroidStudio as you would run any other Flutter app (right-click on the file, run -> debug).
Sometimes the AndroidStudio identifies the file as Dart and not Flutter, so you have to create a new Run/Debug configuration for Flutter instead. At "Dart entrypoint", select the integration file with the "main" func.

native unit test, debugger performing a remote operation that is taking longer than expected

I've written what should be a very simple unit test using the Native Unit Test project in Visual Studio 2011 Beta. The test builds and fails (not unexpectedly), and I need to debug it. When I try to launch the test under the debugger, the debugger never starts, and instead presents this dialog which lingers indefinitely:
Anyone know what might cause this? I've never had this problem with previous versions of Visual Studio.
Update:
I've opened an MSDN thread on this: http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/db3213f8-9658-4470-9e3f-3b67ec954fae
I also opened a connect bug (which apparently was just summarily dismissed): https://connect.microsoft.com/VisualStudio/feedback/details/735369/debugger-wont-start-for-native-unit-test#details
I would need to know some more information regarding this issue but it seems like it is possible that the DebugAttachProcess() method in windows isn't returning which can happen in the case that you do not have enough permissions to do so... make sure you run VS as Administrator, also, you can try to debug it in ollydbg to see if it is an executable problem, although it wont give you the source (you're stuck in assembly).

Resources