Comments (7)
I am experiencing this issue as well with xunit.runner.devices.2.3.3. Tests are not being discovered in my Android unit test app build.
However, I notice the problem only occurs when my Android project's Android Options tab has the option "Use Fast Deployment (debug mode only)" unchecked. If the option is checked (which also requires the "Use Shared Runtime" option to be checked), then tests are discovered.
But I'd like to be able to run tests in a release build and without relying on the shared runtime.
from devices.xunit.
I can confirm that downgrading xunit.runner.devices to v2.2.0 gets test discovery working again, and without requiring "Use Fast Deployment (debug mode only)" nor "Use Shared Runtime". With v2.2.0 I am able to deploy a release build to a device, which has neither of those options checked, and tests are bring discovered.
Might be due to recent changes made to DiscoverTestsInAssemblies()
in src/xunit.runner.devices/DeviceRunner.cs
, e.g. here.
from devices.xunit.
Just in case you are curious about the projects: iOS and Android
from devices.xunit.
I'm looking into this, but I think there's something with the Linker and/or optimizer.
I was able to repro, but debugging is hard since the debugger won't attach in the scenario. I got it to work by setting the Android Options linker mode to None and turning off "Optimize code" on the Build tab.
In that, it works without the shared runtime. I'll keep digging, but this hopefully can unblock you.
from devices.xunit.
It seems that you are right @onovotny . I was playing with custom linker configuration and the minimal configuration that I found working was:
<assembly fullname="xunit.core">
<type fullname="Xunit.FactAttribute" />
<type fullname="Xunit.InlineData" />
<namespace fullname="Xunit.Sdk" />
</assembly>
<assembly fullname="xunit.execution.dotnet" />
<assembly fullname="xunit.runner.devices">
<type fullname="Xunit.Runners.AutomationTextCellRenderer" />
<type fullname="Xunit.Runners.TestAssemblyViewModel" />
<type fullname="Xunit.Runners.TestCaseViewModel" />
<type fullname="Xunit.Runners.TestResultViewModel" />
<type fullname="Xunit.Runners.HomeViewModel" />
</assembly>
Could you add [Preserve(AllMembers=True)]
attribute to all or at least some of these classes?
from devices.xunit.
I can't add those to the main xUnit libs, but it looks like that config file can be added to the devices with the LinkDescription
build action:
https://docs.microsoft.com/en-us/xamarin/cross-platform/deploy-test/linker
from devices.xunit.
That's right. If you are doing something like this, I would recommend to include full assemblies without specifying types and namespaces. Linker's configuration that I presented above seems to be fragile for future changes. I would rather recommend something like this:
<linker>
<assembly fullname="xunit.core" />
<assembly fullname="xunit.execution.dotnet" />
<assembly fullname="xunit.runner.devices" />
</linker>
BTW: If you have another linker script in consuming project, is it safe to add another target with LinkDescription
build action?
from devices.xunit.
Related Issues (20)
- Help with how to use ResultChannel HOT 1
- .txt file not inserted into project on install HOT 1
- iOS 13 can't run test project
- Accessibility problems on Windows Runner
- Testing UWP app fails to start HOT 1
- VS runner does not resolve on netstandard2.0 targets. HOT 2
- Failed MemberData doesn't show in runner app HOT 1
- Visual Studio for Mac
- Extremely poor performance, tests do not complete
- Is Devices.XUnit still be maintained?
- DotNet Maui HOT 1
- Support net6.0+ iOS/Android projects HOT 1
- UWP test runners do not work on Visual Studio 2022 HOT 2
- How do I view/display test results?
- Ability to filter tests HOT 1
- UnitTests from UWP command line
- Device runner for macOS? HOT 6
- Wrong version of xunit.runner.utility.netstandard installed with the latest package version HOT 1
- Test Automation HOT 4
- Templates out of date
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devices.xunit.