In the past couple of days, I've been trying to make it so every time someone push their commit to the repository, it will automatically check if the web build have any errors.
What I've done so far is creating a workflow that builds a web package with Davidobot/love.js and host it with a python http.server. What I've been struggling is I don't really know how to check whether the application has any error since it print out the error in the web console instead of the command line so the workflow can't detect the error.
The Command Prompt and Console for the bug-free version and the error version.
How can I achieve this automatic check and travel to the CI/CD dimension.
Check if the web build is working every time a commit is pushed
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- MynameisBI
- Prole
- Posts: 7
- Joined: Sun Dec 15, 2019 1:16 pm
Re: Check if the web build is working every time a commit is pushed
Maybe use a tool like shot-scraper or other headless solution.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: Check if the web build is working every time a commit is pushed
You can start chrome (or chromium based browsers) with debug output enabled (source):
Then everything that is printed in the web console is also printed to the command line where chrome was started.
Here an simple example javascript in a file called love.js:
And here the command line output:
You can also pipe the debug output into a file:
And analyse that file later.
But this will only tell you if the game is starting at all. It does not tell you if the game works. The game could crash after clicking the first button. If you want to test you game in the pipeline you have to write a bot, that can play it. If it is a turn based game, this could work by taking screenshots, using image recognition (e.g. with OpenCV) and then clicking/typing like a user would. For the browser you could use browser automation tools like Selenium. If it is a real time game this will get very difficult.
Code: Select all
chromium --log-level=0 --enable-logging=stderr
Here an simple example javascript in a file called love.js:
Code: Select all
console.log("Hello World!");
Code: Select all
[13375:13375:1206/212614.492854:INFO:CONSOLE(1)] "Hello World!", source: http://0.0.0.0:8000/love.js (1)
Code: Select all
chromium --log-level=0 --enable-logging=stderr > /tmp/ci/cd/chrome.log
But this will only tell you if the game is starting at all. It does not tell you if the game works. The game could crash after clicking the first button. If you want to test you game in the pipeline you have to write a bot, that can play it. If it is a turn based game, this could work by taking screenshots, using image recognition (e.g. with OpenCV) and then clicking/typing like a user would. For the browser you could use browser automation tools like Selenium. If it is a real time game this will get very difficult.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 5 guests