How to provide multiple exclusions in VsTest Task TestCategory
I am trying to exclude two testing categories from the VS Test task.
I tried including TestCategory!=Monitor|TestCategory!=Regression, but that didn't exclude either category.
I know that when I ran it only as "TestCategory!=Monitor" it properly excluded that group.
So then I tried running the tests with "TestCategory=Regression" and noticed it ran those fine as well.
But, when I try excluded two categories it doesn't seem to work.
Based on this link it seems like I am doing it correctly https://jessehouwing.net/staged-execution-of-tests-in-azure-devops-pipelines/
I also found https://github.com/microsoft/vstest-docs/issues/233 but when I tested with "TestCategory=Smoke|TestCategory=Monitor" it ran fine. I'm wondering if you just can't have multiple !=
do you know?
how many words do you know
See also questions close to this topic
Can't clone from repository of Github in Visual Studio
Recently, my visual studio can't clone from repository of GitHub.
Once it is completed clone, the visual studio will report this error "One or more errors occurred":
I cannot find any error in the output windows in visual studio.
Previously I considered maybe it is the problem of my Visual Studio or Operation System.
However, after I reinstalled my Visual Studio and even reinstalled my Operation System, the problem is still here.
Soon I found a topic may relate my problem:Git has stopped working after installing VS 2022
Whereas, I tried all the ways in it and it doesn't work any.
The version of my Visual Studio is 2022 17.1.6. What's wrong with it?
How can I add intel Fortran compiler after installed intel oneAPI and visual studio?
I installed visual studio 2022 Community. Also, I installed Intel® oneAPI Base Toolkit and Intel® oneAPI HPC Toolkit. However, I do not know how to configure fortran compiler into visual studio so I can make Fortran project. Can you please help me with this?
School Project, set up OpenGL on VS 2019 Community
I am trying to set up OpenGL on my PC for a project. The project gave me sample code to run and a folder to add include directories and libs to my sample code solution in VS 2019 community. The directions were awful and wanted me to upload the include and lib directories to VC++. This did not work even remotely, none of the glfw or glew headers were recognized. I found other directions online to upload the include folders under C/C++>General>Additional Include Directories and the libs under Link>General>Additional Lib Directories. Then I added glfw3.lib;glu32.lib;glew32.lib;opengl32.lib to my Link>Input>Additional Dependencies. This allowed my program to compile. But now I get the following errors plus 90 more like it:
Warning LNK4098 defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library OpenGLSample C:\OpenGL_Projects\OpenGLSample\OpenGLSample\LINK 1 Error LNK2019 unresolved external symbol __imp__TranslateMessage@4 referenced in function __glfwPlatformInit OpenGLSample C:\OpenGL_Projects\OpenGLSample\OpenGLSample\glfw3.lib(win32_init.obj) 1```
How to exclude tagged commit
I have a build pipeline in Azure Pipelines with
trigger: branches: include: - '*' tags: include: - v/*
In other words: I build all branches (in practice I only have one), and all tags that start with
v/(these are my releases).
When I push a commit and its tag, Azure Pipelines kicks off two builds - one for the branch and one for the tag - even though they're the same commit. This takes up unnecessary pipeline resources, particularly when I want to release from many repositories at the same time.
Is there a way to skip the "branch build" of a commit (or cancel if ongoing) when a "tag build" of the same commit is started?
Automate Azure Devops (FTP Upload) and Git to upload on Remote Server
The current setup is as below
- Version Control - Git
- Repos and Branch hosted on - Azure DevOps
- Codebase - External server
The dev team clones Azure Repo into local git project and any staged changes are committed via Git and pushed to specific branch of Azure DevOps. In this setup we would want to upload the changes to external FTP servers and avoid manual upload. Currently trying to use Azure Devops FTP Upload Task (https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/ftp-upload?view=azure-devops), however facing issues; yaml script as below
trigger: - main pool: vmImage: 'ubuntu-latest' variables: phpVersion: 7.4 webAppName: 'Test Project' buildConfiguration: 'Release' vmImageName: 'ubuntu-latest' steps: - publish: $(System.DefaultWorkingDirectory)/AzureRepoName artifact: Test Project Deploy - task: FtpUpload@2 displayName: 'FTP Upload' inputs: credentialsOption: inputs serverUrl: 'ftps://00.00.00.00:22' username: ftp-username password: ftp-password rootDirectory: '$(System.DefaultWorkingDirectory)/AzureRepoName' remoteDirectory: '/home/public_html' clean: false cleanContents: false preservePaths: true trustSSL: true
Following errors occur when I commit (for test purposes) something.
Starting: PublishPipelineArtifact ============================================================================== Task : Publish Pipeline Artifacts Description : Publish (upload) a file or directory as a named artifact for the current run Version : 1.199.0 Author : Microsoft Corporation Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/publish-pipeline-artifact ============================================================================== Artifact name input: Test Project Deploy ##[error]Path does not exist: /home/vsts/work/1/s/AzureRepoName Finishing: PublishPipelineArtifact
I want to upload any staged change that is committed to main branch on Azure Devops to be automatically deploy on the remote FTP server
Migrate Azure Devops Artifacts between organizations
I am trying to migrate (clone) an Azure Devops project to another project / organization. I successfully
- cloned the repos
- migrated the work items using Azure DevOps Migration Tools by NkdAgility
- I exported the build and release pipelines as json files and imported them again.
- I created a selfhosted agent on my VM and trying to run the build pipelines - the job "dotnet restore" on that.
- I created a new feed under Artifacts. Unfortunately the job with dotnet restore fails because it relies on the artifacts only available in the old project
How can I migrate the packages from the feeds of the old project to the new one(s)?
I assume I am supposed to clone the feeds of the old project somehow so that I can simply update the nuget.config with the name of the new organization. Thank you in advance.
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <!-- remove any machine-wide sources with <clear/> --> <clear /> <!-- also get packages from the NuGet Gallery --> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> <add key="DotNetArcade" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" /> <add key="<OLD_FEED1" value="https://pkgs.dev.azure.com/<old org>/_packaging/<OLD_FEED1>/nuget/v3/index.json" /> <add key="<OLD_FEED2" value="https://pkgs.dev.azure.com/<old org>/_packaging/<OLD_FEED2>/nuget/v3/index.json" /> <add key="<OLD_FEED3" value="https://pkgs.dev.azure.com/<old org>/_packaging/<OLD_FEED3>/nuget/v3/index.json" /> </packageSources> <activePackageSource> <add key="All" value="(Aggregate source)" /> </activePackageSource> </configuration>
Azure pipeline | VSTEST Database tests - connection timeout expired
Recently I faced issue with running database tests on azure pipeline. To execute tests I use vstest@2 task:
- task: VSTest@2 inputs: testSelector: 'testAssemblies' testAssemblyVer2: | **/*.DatabaseTests.dll **/*.Tests.dll searchFolder: '$(System.DefaultWorkingDirectory)' distributionBatchType: basedOnExecutionTime runInParallel: true
Occasionaly this error occurs for some reason and fails one of for example thousand tests and fails run.
Microsoft.Data.SqlClient.SqlException : Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=105810; handshake=26; Data: HelpLink.ProdName: Microsoft SQL Server HelpLink.EvtSrc: MSSQLServer HelpLink.EvtID: -2 HelpLink.BaseHelpUrl: https://go.microsoft.com/fwlink HelpLink.LinkId: 20476 ----> System.ComponentModel.Win32Exception : The wait operation timed out.
Most threads I found about this error are about consistent fails and are releated to wrong port or connectionstring or connectiontimeout setups. This however acts pretty weird as it fails one testcase randomly.
Full stack trace
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParserStateObject.ThrowExceptionAndWarning(Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error) at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync() at Microsoft.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket() at Microsoft.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean& marsCapable, Boolean& fedAuthRequired) at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool) at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
I apologise if I'm missing something really obvious I'm quite new to topic
VSTEST@2 - error could not find testhost | Azure Pipelines
I'm running tests solution on azure pipeline with help of vstest@2 task. Pipeline distributes test cases on 4 agents and then runs them.
- task: VSTest@2 inputs: testSelector: 'testAssemblies' testAssemblyVer2: | **/*.Tests.dll searchFolder: '$(System.DefaultWorkingDirectory)' distributionBatchType: basedOnExecutionTime runInParallel: true
On beginning of the run I get bunch of these messages :
##[error]DiscoveryMessage : Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo) at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)
and after that tests start passing and run goes further.
I have two questions about this - what does these messages actually mean / should I intervene in some way?
Can I somehow disable these messages so they dont spam my run log ?