Mac : Run Foundation Tool app as cronjob? - xcode

This may not be completely programming related ...
In Xcode I wrote a little Foundation Tool application for maintenance. Copy files from A to B , delete logs and so on. Now I want to run the application in background once a day or once an hour.
How do I set this up?
Can it be done with a Foundation Tool application or is there another Xcode project type for tasks like this?

Assuming the "Foundation Tool application" is a command-line application, then you should be able to run it from cron just fine.
Another way to run it (if you want to be consistent with the OS X built-in daily maintenance scripts) would be to run it from a script in /etc/periodic/daily (look at the existing scripts there for examples)

Related

how to run a self-contained asp.net core api in Mac Os

At first I have to apologize that I know it's a stupid question but since I don't have Mac computer so I can't test it as well, and I also failed to find document in Microsoft about the actions after publish, then I reach here to gather a confirmation from wise SO contributers.
I have an asp.net core project and I published it as self-contained application. When I choose the target OS as windows, then I will get an EXE file in the publish folder, then in a windows OS without .net runtime, I can still run the app by just double clicking the exe file.
Okay, then here's the question, when I choose the target OS as osx-x64, I can get a file like screenshot below. Then if I have a Mac computer, how can I run this File? The Mac wouldn't have .net runtime, and at first I think this app may also can be run by just double clicking the file. Am I right? Or it should be run within a command line like cd xxx first then ./filename?
Thank you very much in advance for your confirmation.

How can I use Sikuli4Net or SikuliSharp with Visual Studio for Mac to test .NET Core cross platform applications on MacOS?

I have a cross-platform desktop application written in Xamarin.Forms that runs both in Windows and MacOS. I want to do some UI automation on top of that application.
After some research it seems like the most cross-platform friendly option is to use Something like Sikuli. As the default stack on our team is centered on the .NET stack we want to use SikuliSharp or Sikuli4Net to perform the automated UI tests.
However, despite of the fact that we've been able to run Sikuli4Net successfully on Windows, automating several flows so far. We have a dire situation on MacOS. Our team (myself included) doesn't have a lot (or maybe any) knowledge of Java applications.
I've installed the JDK 8, but was unable to run the tests in the same way we did on Windows. The code builds, but it seems like something in the environment is lacking.
With Sikuli4Sharp when starting the APILauncher like this:
launch = new APILauncher(true);
launch.Start();
I get the following error:
With SikuliSharp when trying to run a simple demo application on our software I have this error:
I have tried to set up the SIKULI_HOME environment variable using this answer as a reference, but still the same problem (and I did restart the console and IDE, even my machine).
When I run echo $SIKULI_HOME on the terminal I do get the directory that cointains the .jar files:
So I'm kind of lost about were to go from here. These problems made me unsure about being possible to run Sikuli4Net or SikuliSharp on MacOS environments. Is this the case? If not, what am I doing wrong?
as mentioned in the error message: sikuli-script.jar is missing.
You have to check on what version of Sikuli/SikuliX your SikuliSharp or Sikuli4Net are depending on.
In doubt you have to dive into the sources of those Net packages.

How to write a program to run same script using multiple external tools in eclipse

I write automated tests. We have different environments we run the tests in for different customers that we provide the same services to before they can be pushed to out automated testing servers. To ensure a test is working we need to run the tests using different external tools in eclipse each time and record and report on it passing/failing. To do this we need to click the green play button with the red toolbox and select an external tool individually each time.
I'm looking for a way that I can write a script that will let me specify which external tools to run the test with and then it'll run the test over and over with the different tools and output some kind of report. I'm not familiar with this kind of thing so any kind of direction would be a huge help.
I'm using Eclipse Keplar on Ubuntu 16.04. The test is a ruby script.
You can use scheduler of ubuntu system and execute shell script command to trigger automation.

Automated integration testing of a client/server Windows desktop application

My team is developing a desktop application (mixed C++/Tcl) that is used in a client-server setup. Currently it is Windows-only, but soon we will need to port it to Linux. CruiseControl.NET builds it every night from the source code in SVN and packages it into NSIS installer, but we have no automated tests to run.
It is nearly impossible to add any unit tests, but integration testing of the application is easy, because it is already heavily script-based.
The main task is to install the app into 3 PCs, configure it (that involves copying some files around), run it, monitor a possible crash, wait till integration testing is done, collect a summary, send emails. It could be done with a bunch of custom PowerShell scripts, but
In future we will want to add more features and more testing, and
what used to be a simple script soon blows up (as usual), so I want
to minimize custom scripting, and if I need to script something, I
prefer bash/cygwin (I am not familiar with Python or Ruby).
I want a web dashboard that will report current progress, and if
something failed - show logs
I need some supervisor that will monitor the app under test and
report if it hangs or crashes
we will need to test it also on Linux
ideally I would like to orchestrate some test steps between the PCs
(e.g. run test X on PC1 and test Y on PC2 in parallel, wait till they
both finish, then run test Z on PC1, while monitoring that nothing
crashes on PC2 etc)
So, I am looking for a COTS tool/set of tools that will help me to do it and don't have a steep learning curve. Ideally, for free, but if it is really good and has fair pricing, my company may purchase a license.
The process should be triggered from CruiseControl.NET when the NSIS installer is ready, and then perform everything described above. Basically, it should allow at least remote installation of software, running custom scripts and have a web dashboard.
Apparently, SCCM tools like Chef could be used, but so far neither of them supports a Windows server, only nodes. I would like to avoid setting up a Linux VM just for that, although I can do it, if I have no other choice. Also, Chef seems to be a bit overkill - good for 10k machines, but I have only 3... maybe 5 in future. And I am particularly curious about chances to orchestrate a distributed test.
Most of the similar questions here on StackOverflow and in internets are about web apps, Java containers, Maven etc, and there are just so many tools and plugins for these tools to evaluate.
Thanks in advance.
Install ccnet on your test machines. Have those ccnet projects listen to a file that gets edited when a new installer is ready. Have the test machines install that new installer and run tests. There you go. ccnet sends emails so there's your basic reporting.
Have the test results get reported into a database via web services using gSOAP(that's what we did). For linux you can run java cruisecontrol if you must. Write a gSOAP enabled test controller program to report the test results from the test machines. A little c++ app will do. Then write a website(we use ASP.NET) to query the database(Postgresql) and show results. Have the test machines auto update themselves via SVN to get the latest changes to the configuration. Use Nant. Nant is far superior to just using ccnet to run tasks. Nant works through ccnet. Use XML, XSL and CSS with ccnet to make test emails have the information you want(new passes, new failures, SVN differences to code bases, etc...)
Our latest development is putting a big TV in the kitchen with a summary of test results so people can know more readily what they broke!
The first thing I'd get working is a test machine listening for the new installer, installing it, running some basic tests and emailing the results back. Put the ccnet and nant configuration in version control and get that auto updating on the test machine so you don't have to log into every test machine and do an update every time you make a change.
This is hugely broad and pretty close to opinion based. Chef can handle steps like deploying the application to the test machines but it isn't a GUI test framework so you would need something else to handle that. Jenkins supports distributing tests to windows hosts so that seems like a good choice on that side of things but it isn't that great at multi-node tests or orchestration between them. I suspect you'll need to write most of this yourself given the requirements.

Erlang application launch on a Windows server

I have an Erlang application that is deployed on a server with Windows Server 2008.
The way I do this:
Copy application folder in Erlang lib directory.
Open command line (cmd). Execute erl.
Execute application:start(app_name) in Erlang shell.
Are there any better approaches to launch the application? How to make the application to launch on Windows startup?
I have no experience with Windows but...
`1. First of all, you might want to have a look to the concept of release in Erlang. Essentially,
When we have written one or more applications, we might want to create a complete system consisting of these applications and a subset of the Erlang/OTP applications. This is called a release.
`2. Then, you might want to create a script that contains something like:
erl -boot ch_rel-1
Where essentially you're starting Erlang/OTP using a boot script that you created above (just follow the instructions in the releases page)
`3. This article explains how to create startup scripts in Windows Server 2008 (not tested, just googled):
http://technet.microsoft.com/en-us/magazine/dd630947.aspx
Hope this helps. Nice question.
Perhaps rebar might help. It makes building an app skeleton and release quite easy. A nice tutorial is here.
After getting familiar with releases, take a look at manual pages (erl -man ) for start_erl and erlsrv. I used them to start embedded system ( http://www.erlang.org/doc/embedded/embedded_nt.html ) in windows 2003, hope it still works for you in windows 2008.
After creating service with erlsrv it is possible to manage it via standard windows command line and GUI tools, e.g. setting start mode and restart policy.
May be you could start just your application by supplying "-s app_name" as erl/start_erl additional flag, but I didn't try that, as I had to go long route with embedded system release. In that case make sure you have "start() -> application:start(?MODULE)." in your "app_name.erl".

Resources