Continuous Integration on Gitlab with a Console App - asp.net-core

I am developing a simple console application with .NET Core 2.
Its purpose is to clean up a Database once per day.
This means the application does never stop after once started.
This application is part of Solution where also a .NET Core Rest API lives, to access the same database so its also part of the same Gitlab repository.
Now i want to publish and start the console app via the existing Continuous Integration pipelines of the repo. (CI pipeline is working perfectly for the REST Api project)
Building, testing and publishing works perfectly, the only problem is running the console application.
I tried a few attempts by now, the outcome is always, that the pipeline gets stuck after the application startet. I guess it is like that because it waits till the app finishes, what never happens.
I tried by now:
starting the app directly in the gitlab_ci.yml
gitlab_ci.yml:
-cd C:\publishFolder
-DB_Cleaner.exe
-> The application is executed directly in the Runner console
gitlab_ci.yml:
-cd C:\publishFolder
-start cmd.exe /k DB_Cleaner.exe
-> The runner is stuck till it got canceled by timeout
Running a bash or powershell script to run the application
gitlab_ci.yml:
-cd C:\ScriptFolder
-runDBCleaner.cmd
runDBCleaner.cmd:
-cd C:\publishFolder
-start cmd.exe /k DB_Cleaner.exe
-> The runner is stuck till it got canceled by timeout
Runner is running on a Win-64 virtual machine.
Is there a way to start the application to run Independent from the gitlab-CI-Runner?

See This Forum. It is working for me using this script:
- 'powershell.exe D:\app\CiTest.exe'
The CiTest.exe is a .Net 4.8 console app.

Related

How to prevent saving background job calls in logs.txt file

I am working on project that is uses abp (asp net boilerplate) v 6.3.0 and dotnet core v5 with reactjs client.
After run its server with dotnet run, I see some logs on the terminal that is show the background jobs are working and this messages are saving in the logs.txt file.
after some moment the logs.txt file was very huge and find some especial error in it is very hard.
could you help me to disable log the background job worker?
vs code terminal after dotnet run in host
logs.txt file
I was suffering the same issue here, and found a way to do this through log4net (not abp). The trick I used is prevent logging from specific loggers (the ones that keep logging every 5 seconds). Here is the log4net config file, with the added filters
log4net config with

How to run e2e tests automatically?

I really don't know how to ask question to Google about this, so I excuse me that it is naive.
Our team is developing SPA application in ReactJS. We also do back-end programming for NodeJS. Our project recently got more e2e tests. They are written using webdriver.io packages. Everything works as expected but circa 30 tests run about 50 minutes. It is too long to pause developer work and force him to run tests.
We came with the idea that now when we have so many tests, we need to run them on separate computer (other than a developer's laptop, further I call it e2e-laptop).
So I programmed a bash script and installed Ubuntu on a e2e-laptop. My idea is, that developer who wants to run e2e test logs in on e2e-laptop with ssh, runs specified script with arguments (eg: --rev= specific git revision the tests should run on, --email= where to send Allure report) and logs out. After tests are done he gets Allure report in his mailbox.
This all sounds to me OK, but not very well. It works - it is like a dirty MVP. But what I really would like to give my team is the web browser based UI that gives the features my script has. I can imagine this software is hosted on e2e-laptop, every developer can open its webpage address in his local browser. Then after authorization, there are options: run all specs, run chosen specs, send report and more. It would be the best if that software could also allow simultaneous running of tests commissioned by multiple developers.
What software I need?
You need a continuous integration tool. https://stackify.com/top-continuous-integration-tools/
I recommend Jenkins.
I would first try to run your selenium tests headless in a docker container on your laptop. Once you are able to do that, use that same configuration in your docker container running in Bitbucket pipelines. It could actually be the same container and the same scripts. Then, developers can just make a branch and work with the tests on that branch. If only a certain subset of tests need to run, then the developer can make the necessary changes on his or her local branch to run those tests and push it up to Bitbucket. This should help with the configuration https://github.com/SeleniumHQ/docker-selenium.

Multiple ASP.NET 5 apps using DNX-watch command

I was successfully able to get DNX-Watch command using ASP.NET 5 beta 8. Its great feature though my requirement is little bit more.
I have two projects ASP.NET 5 Web API project, normal Static HTML web app(like mini SPA).
What I would not achieve is running DNX-Watch command for both projects. Only one project can run at "localhost:5000" but if I want to run other project. An error is thrown "localhost:5000" already running.
What to know if DNX-watch runs against only project?
Running multiple apps on the same port is not a dnx-watch issue. You'll get the same error if you try to start the two apps by hand too. You have to a different port for each application
Currently dnx-watch supports only one startup project per watcher instance. However, you can start multiple instances of dnx-watch and you can achieve the same result. I don't think we'll add multiple startup projects support because it creates some strange complications around console input/output and environment setup.

Microsoft Access automated build hangs at creation of .ACCDE

I'm attempting to automate the build of a source controlled MS Access application (it's only the front-end, the back-end is SQL Server). The Access client is published to the users via a simple C# console app via ClickOnce... It's in that console project that I'm also building the MS Access application via a custom msbuild tasks from this CodePlex library: https://buildmsaccessdb.codeplex.com/ (which is also mentinoed in another StackOverflow post on the subject). On my machine, it all works fine. The Access source code is compiled into an ACCDB, which is then converted into an ACCDE which is what gets included in the published app.
However, when I make it an automated build in TFS, it always stalls at the step where it converts the ACCDB to an ACCDE. I've tried a variety of ways for executing the "Make ACCDE" (SysCmd 603) command. I've tried it in powershell scripts, in VBA, etc... but it always seems to stall. Is that because the automated build process is not an interactive process and maybe the the SysCmd 603 needs to be ran interactively? If I stop the build and take a look at the ACCDB, everything is good. It compiles and can be manually compiled into an ACCDE... so it's not that the ACCDB isn't compilable.
I'd like to test it as an interactive TFS service but I don't control the service account it's running under.
Any tips on suggestions are welcome and thanks in advance! We have this whole automated build and release process up and nearly working except for this one piece!
I don't know much about the MSBuild task library, but from a quick look at the source it looks like it opens Access to run the tasks and interacts with a dialog box at one point. If that's the case you'll definitely need to run the build in interactive mode.
The fact that your build is hanging and not erroring out would also indicate this is the case.
Even though you don't control the service account, I would presume there's someone else in your organisation that does. I'd suggest you work with them and to try the build in interactive mode and ensure it works. If needed you could always set up a second build machine that runs in interactive mode, with the current build server remaining in "run as a service" mode.

Unable to get IIS Express server running in Jenkins

I'm trying to run Selenium tests utilizing an IISExpress server. I'm using the VSTest plugin to run my tests. Everything works fine locally in Visual Studio but when I run the tests in Jenkins the IISExpress process never starts. I even tried adding a Windows Batch Command step in Jenkins specifically for loading up the server, but even that doesn't seem to do anything. When I run Jenkins as a service that can interact with the desktop and I watch what its doing, I can see that Selenium loads up the browser but IISExpress just never starts. Any thoughts on this?
You should be able to launch IIS Express through command prompt by either
Explicitly providing the /path:"#PATH" and /port:"#PORT" command line arguments, and then invoking an asynchronous call to the IIS Express executable.
Your command in Jenkins should be something along the lines of:
start "YOUR_IIS_EXPRESS_EXE" /path:"PATH_TO_YOUR_APPLICATION" /port:"YOUR_APPLICATION_PORT"
Or by
Providing a value for the /config command line argument.
Whilst using this technique however, ensure that your application is the first entry in the application host.config file.
The Jenkins command should then be something similar to:
start "YOUR_IIS_EXPRESS_EXE" /config:"PATH_TO_YOUR_APPLICATIONHOST.CONFIG_FILE"