Trying to get testcafe, saucelabs and circleci working together but having no luck - automated-tests

So I have the following in my package.json:
test-sl-one: "testcafe \"saucelabs:Chrome#beta:Windows 10\" tests/settings/users.js -r xunit:/tmp/test-results/res.xml"
I see the tunnel "active" on the saucelabs site.
I wait about four minutes, and then I get back the error:
testcafe-automated-tests#0.0.1 test-sl-one /home/circleci/repo
testcafe "saucelabs:Chrome#beta:Windows 10" tests/settings/users.js -r xunit:/tmp/test-results/res.xml
ERROR Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.
Any advice on where to start to triage it etc would be greatly appreciated! :)
Details: I successfully run testcafe tests on circleci not using saucelabs (just using a docker image that has chrome/firefox in it).
Also, my tests are running inside a docker container (maybe I should stop doing this part)

Related

Docker container failed to start when deploying to Google Cloud Run

I am new to GCP, and am trying to teach myself by deploying a simple R script in a Docker container that connects to BigQuery and writes the system time. I am following along with this great tutorial: https://arbenkqiku.github.io/create-docker-image-with-r-and-deploy-as-cron-job-on-google-cloud
So far, I have:
1.- Made the R script
library(bigrquery)
library(tidyverse)
bq_auth("/home/rstudio/xxxx-xxxx.json", email="xxxx#xxxx.com")
project = "xxxx-project"
dataset = "xxxx-dataset"
table = "xxxx-table"
job = insert_upload_job(project=project, data=dataset, table=table, write_disposition="WRITE_APPEND",
values=Sys.time() %>% as_tibble(), billing=project)
2.- Made the Dockerfile
FROM rocker/tidyverse:latest
RUN R -e "install.packages('bigrquery', repos='http://cran.us.r-project.org')"
ADD xxxx-xxxx.json /home/rstudio
ADD big-query-tutorial_forQuestion.R /home/rstudio
EXPOSE 8080
CMD ["Rscript", "/home/rstudio/big-query-tutorial.R", "--host", "0.0.0.0"]
3.- Successfully run the container locally on my machine, with the system time being written to BigQuery
4.- Pushed the container to my container registry in Google Cloud
When I try to deploy the container to Cloud Run (fully managed) using the Google Cloud Console I get this error: 
"Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information. Logs URL:https://console.cloud.google.com/logs/xxxxxx"
When I review the log, I find these noteworthy entries:
1.- A warning that says "Container called exit(0)"
2.- Two bugs that say "Container Sandbox: Unsupported syscall setsockopt(0x8,0x0,0xb,0x3e78729eedc4,0x4,0x8). It is very likely that you can safely ignore this message and that this is not the cause of any error you might be troubleshooting. Please, refer to https://gvisor.dev/c/linux/amd64/setsockopt for more information."
When I check BigQuery, I find that the system time was written to the table, even though the container failed to deploy.
When I use the port specified in the tutorial (8787) Cloud Run throws an error about an "Invalid ENTRYPOINT".
What does this error mean? How can it be fixed? I'd greatly appreciate input as I'm totally stuck!
Thank you!
H.
The comment of John is the right source of the errors: You need to expose a webserver which listen on the $PORT and answer to HTTP/1 HTTP/2 protocols.
However, I have a solution. You can use Cloud Build for this. Simply define your step with your container name and the args if needed
Let me know if you need more guidance on this (strange) workaround.
Log information "Container Sandbox: Unsupported syscall setsockopt" from Google Cloud Run is documented as an issue for gVisor.

Fail to Run Openvswitch 2.5.0

I've removed the openvswitch version I had, and I downlaoded version (2.5.0) following the same steps in this link (https://github.com/mininet/mininet/wiki/Installing-new-version-of-Open-vSwitch) and instead of (OpenVSwitch 1.10) I used (OpenVSwitch 2.5.0). The installation went smoothly without error, but when I try to run mininent and got the following error. I've tried some suggestions I found online but none of them works.
ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
ovs-vsctl exited with code 1
*** Error connecting to ovs-db with ovs-vsctl
Make sure that Open vSwitch is installed, that ovsdb-server is running, and that
"ovs-vsctl show" works correctly.
You may wish to try "service openvswitch-switch start".
Could you please advise me what to do ?
Cheers,
Tom
We need 2 processes for that.
ovsdb-server
ovs-vswitchd
These 2 will be started with following command.
/usr/local/share/openvswitch/scripts/ovs-ctl start
In my case, /usr/local/share/openvswitch/scripts is the default location for ovs-ctl scriot,
Hope that helps.

TVMLKitErrorDomain error 3 Message

I have a TVML app working quite nicely now in the simulator. I've started with a menuBar template, and have used a stackTemplate as well as productTemplate. Everything is working just dandy in the simulator. However, when I hook my Apple TV up and try to run it on there, the application loads, but then I get the following error:
TVMLKitErrorDomain error 3
I have been trying to find out what this is for a few days , but I have not found any information pertaining to the error code. The simulator version is running on the localhost 9001 like Apple recommends and that is flawless. I just can't get the app to run properly on the device though. Does anyone know what that error is, and how I can fix it? As always I appreciate your help!
You need to run this command from the same directory as your TVMLKit JS file:
python -m SimpleHTTPServer 9001
.
I had same error in my TV app. Solved by editing Info.plist. This error indicates that URL user trying to visit is not reachable.
You need to allow http:// from Info.plist for your app.
If you are running on device, you should change this line from localhost to your IP address:
static let TVBaseURL = "http://localhost:9001/"
to
static let TVBaseURL = "http://MY.IP.ADDRESS.HERE:9001/"
Just open a new terminal at your app folder and run the following command before running the simulator:
ruby -run -ehttpd . -p9001

Meteor Velocity; using CLI getting timeout

Simple tests are timing-out intermittently on CircleCi. This only happens on CircleCi, locally on OSX, all testing is fine. Anyone having success with CircleCi specifically?
Running tests should be straightforward, but no one at CircleCI, or at the velocity forum have been able to solve this.
I've used the simple example tests from sanjo:jasmine. Intermittently, velocity hangs and goes to timeout. No errors. Nothing informative in logs. Strangely it did work once on CircleCi, and then never again.
The test command is simply:
meteor --test
The output I get doesn't print any tests:
stream error Network error: ws://localhost:3000/websocket: connect ECONNREFUSED
[[[[[ ~/app ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/
In the .meteor/local/log/jasmine-client-unit.log this is the last line:
Chrome 38.0.2125 (Linux): Executed 0 of 0^[[32m SUCCESS^[[39m (0 secs / 0 secs)
^[[1A^[[2KChrome 38.0.2125 (Linux): Executed 0 of 0^[[31m ERROR^[[39m (0.023 secs / 0 secs)
I confirmed that the versions are the same Meteor 1.03.2, Node 0.10.33, Phantomjs 2.0.0, Chrome 40. Sorry that I can't provide a reproducible repository, it's a very intermittent error likely related to environment.
Try meteor --test --once
The once might be the reason it's not finishing up
edit
It turns out that jasmine end to end testing recommends webdriver as well. So my advice below should still apply for jasmine.
/edit
What framework? If it is cucumber, the issue is the phantomjs version that gets installed doesn't install the right binary for some reason.
For that reason, in CI, you need to install phantom and set the path as an environment variable.
npm install -g phantomjs
export PHANTOM_PATH=`which phantomjs`
This will tell webdriver to use your path of the correctly installed binary instead of the wrong version.
We should really just fix Cucumber.js to not fail silently.
The other error you are seeing about websockets is just --test not connecting right on startup, it doesn't affect anything.

xinit Clutter application not working

I've built a simple test app with clutter: A stage with two ClutterText actors to display two words. It works OK when I run it from within gnome but running it from the tty (not gnome-terminal or xterm) with xinit my_app_binary I get an error:
failed to create drawable
Unable to initialize Clutter: Unable to select the newly created GLX context
Window manager error: Unable to initialize Clutter
If I run xinit gnome-terminal from the same tty everything works, gnome-terminal shows up in a black screen. That's the same I want to do with my app.
Is there anything I can do to overcome this error?
All the above are tested in Linux Mint 12. After normal boot I switch to a tty (ALT-F1) and stop lightdm (sudo /etc/init.d/lightdm stop).
Thanks!
EDIT: running as root everything works, so the question is: how to run it as a regular user?
Be sure to set the DISPLAY-var - add it in front of your command
DISPLAY=:0.0 /path/to/myapp
Sometimes this is an access-rights problem - the app should be started with the user who started the X-server
su user-started-x -c 'DISPLAY=:0.0 /path/to/myapp'

Resources