Make a physical stoplight react to Jenkins build - web-services

I'm trying to create a simple program to have an actual stoplight show red or green based on whether or not my integration tests pass in Jenkins.
Red - No
Green - Yes
I realize this is very vague, but any sort of tutorial that hooks up any physical relay to a light from a raspberry pi that uses a web-hosted variable should be enough to get me going.

I used this API when I did mine.
Mine was super simple/simplistic. I was able to write a bash script using this API GPIO cli stuff. It just turns the pin on or off, so I have a script to turn the pin on and one to turn a pin off.
I used a web server and ran them as CGI scripts. So essentially the Rpi runs a web server, you hit a page that runs the on bash script. You hit another page that runs the bash off script.
Here's my project on github. It's a mix of my playing around and the actual code I used to get it to run.

Related

How do I make Drone OSS build anything?

I have built the Drone OSS using instructions at https://github.com/harness/drone/blob/master/BUILDING_OSS and successfully connected it to GitHub, it is triggering builds and I can log-in to the UI.
However, nothing happens after a build is triggered, the pipeline is stuck in Loading... and step does not execute.
Now this is not my first rodeo with Drone, I have the enterprise one running just fine, with runners connected and builds running fine. So I am relatively certain I don't have setup issues.
It is my understanding the OSS one does not support runners, and sure enough when runners try to connect to it they get 404 on the API endpoints they are trying to connect to.
So the question then is, how does one actually build anything with Drone OSS? what pipeline syntax / config must one use?
I am at a loss.
Solution: Start server with DRONE_AGENTS_DISABLED=true
Source: https://community.harness.io/t/drone-community-not-running-builds/11024/5

Web service to interact with running electron app

I looking for some advice on the best way to set up a project. Not sure if this is the right place to ask but I will give it a go.
I am looking to create a "Smart Mirror". I know there are options already available for this but I want to go through the process of creating my own.
I have created the UI using electron and I am using this on a raspberry pi 3b+ using raspian stretch.
Now this is where my knowledge is lacking, due to no experience and not sure if what search terms to look for.
I would like to create a plug in on Chrome(used on my mobile phone) or a process that runs separately, to say "Send page/video to Smart Mirror". What I envisage is that this plug in will copy the URL for the page or the video and send this via a web service call. The running electron app on my raspberry pi will receive this call and process the URL and then display the page/video within a portion of the application.
I have only ever consumed a web service from within an application.
I am not sure how to set this up. Can my electron app be set up to receive this call? If so what search terms should I be looking for?
I hope this makes sense.
Please let me know your thoughts or if I am thinking about this all wrong

AWS Device Farm - Disable tutorials on devices

I am doing automated tests [Android / Appium Java JUnit] with the AWS Device Farm service, but they are interrupted by the use tutorials that appear on the devices, for example, the tutorial of how to use the camera. I want to know if there is a way to disable the tutorials of the use of the device. Thanks.
I work for the AWS Device Farm team.
We detected and root caused this issue where a one-time tutorial popup appears on some phone's camera apps. We've corrected it, so feel free to try again and let us know if this problem is still affecting you.
Looks like there is also a script you can run from this AWS forum post
https://forums.aws.amazon.com/thread.jspa?threadID=294719
Hi,
I'm so sorry this keeps happening to you. We do currently only have the dismissal running on some devices like the Samsung S9, and are going to be enabling it for other devices soon, in the coming weeks. What I can do now is provide you a script to verify that theyre dismissed yourself at the beginning of your test. If you're using "custom environment mode", add the following 2 lines to the pre-test section of your test spec file:
curl https://s3-us-west-2.amazonaws.com/aws-devicefarm-support/chrome_initialization_and_popup_detection.py -o chrome_initialization_and_popup_detection.py
- python chrome_initialization_and_popup_detection.py -v --retries 2 --output-dir $DEVICEFARM_TEST_PACKAGE_PATH/popup_dismissal
This will run our popup dismissal script in your own code to verify that any device you run on gets all popups dismissed. It shouldn't be necessary for some devices like the S9, but just in case any do happen to creep up, this will dismiss them for you. I'll also double-check on our end why some popups like the S9 popup aren't getting dismissed properly.

Python Code Coverage over XMLRPC connection

I am working on an Automation project which has some xmlrpc calls integrated with it, as my setup is based on client server model.
I want to get an end to end code coverage details for the complete project while running automation tests.
I am wondering if there is any way through which we can determined code coverage over xmlrpc calls ? I have tried working with coverage.py but it works fine for local code only. Seems it can not go beyond rpc.

Calabash how to speed up execution time

I have a Android device connected to my PC.
Running a calabash test I use the following command:
calabash-android run <NAME>.apk features/<NAME>.feature
Now before running a feature Calabash always uploads the application again witch takes time.
How can I disable this?
Any help would be appreciated!
Thank you!
You can control the reinstallation of the app using the hooks file. This contains the cucumber hooks for before and after scenario. If you didn't make the hooks file that you are running then it's probably one from a sample project.
The bit you're looking for is the 'reinstall_apps' command. If you remove it completely then your app won't ever be reinstalled, which can be a bad thing as it's sometimes necessary to reset the app completely. The way I handle it is to tag the features where I do want the app reinstalled with #reinstall_app and then
Before do |scenario|
puts "Starting scenario - #{scenario.name}"
reinstall_app if scenario.source_tag_names.include?('#reinstall_app'))
...
end