9.9 KiB
Advanced Linyaps Application Compatibility Testing -- Linyaps Application Automated Testing Suite
As you may have noticed, in our previous Linyaps application compilation, we manually installed packages and launched applications to test compatibility
However, this raises a question: as the number of applications that need testing continues to increase, doesn't the manual testing approach seem relatively inefficient?
To address this, I would like to introduce to you the Linyaps Application Automated Testing Suite -- Next Linyaps Testing Toolchains currently available to ecosystem contributors in the Linyaps community
Project Introduction
Next Linyaps Testing Toolchains is a Linyaps application testing toolchain composed of shell scripts, designed to bring more convenient solutions for Linyaps application testing
This project is the legitimate spiritual successor of linglong-automan and promises to remain open source forever
Implemented Features
-
Organize scattered
*binary.layerfiles in a specified directory into a standardized directory structure:xxx/id/packageand generate two tables storing Linyaps application IDs and application version numbers -
After specifying the organized Linyaps file storage directory, start the streamlined installation process
-
After specifying the resource storage directory and application information table, simulate launching applications through desktop files based on
installation status,desktop file existence status, andwindow generation status, and take screenshots of test results * The current code partially depends ondeepin 23system components and needs to be re-adapted when used on other distributions -
Scan icon files for installed Linyaps applications, determine whether the current application icons directory and files comply with
Freedesktop XDGspecifications, and collect icons -
Batch uninstall installed Linyaps applications
Code Structure Analysis
Entering the suite repository, you can see that the suite is divided into several key independent scripts according to function/role, roughly:
linyaps-auto-optimize.sh, Linyaps application installation packagebinary.layerorganization tool. Organize allbinary.layerfiles in a directory into a structure suitable for the testing suite and produce two tables for recording Linyaps application IDs and version numbers, such as:
org.qbittorrent.qBittorrent/package/org.qbittorrent.qBittorrent_4.6.7.22_x86_64_binary.layer
com.poki.apple-knight-golf.linyaps/package/com.poki.apple-knight-golf.linyaps_28.3.3.2_x86_64_binary.layer
ll-pkg-name.csv
org.qbittorrent.qBittorrent
com.poki.apple-knight-golf.linyaps
ll-pkg-version.csv
4.6.7.22
28.3.3.2
-
linyaps-auto-install-release.sh, Linyaps application installation packagebinary.layerbatch installation tool, used to install packages organized bylinyaps-auto-optimize.sh -
linyaps-auto-screenshot-deepin23.sh, application automated testing suite, including running status screenshot function, only fordeepin 23environment -
linyaps-auto-screenshot-general.sh, application automated testing suite general version, does not include running status screenshot function, for non-deepin 23 environments -
linyaps-auto-uninstall-release.sh, Linyaps application batch uninstallation tool
Next Linyaps Testing Toolchains Practical Application
After introducing the overall functions and code logic, we demonstrate how to complete batch testing of Linyaps application installation packages binary.layer produced in previous lessons through the Linyaps Application Automated Testing Suite based on deepin 23
Environment Preparation
Before starting to use the testing suite, you need to ensure that the current environment meets the following conditions
- Some functions of the self-service compatibility testing suite used in this practical demonstration require the use of
Linux x11window management tools, so you need to install the following software packages before use:
wmctrl x11-utils
-
The testing suite uses x11 window management tools to determine application window startup status, so you need to ensure that your system is an
x11environment rather than aWaylandenvironment -
wmctrlandxwininfocomponents can work normally, and window information can be queried throughxwininfo -
Since
deepin 23provides compatibility testing result screenshot function, you need to install related software packages:
deepin-screen-recorder imagesmagick-6.q16
- Manually start
deepin-screen-recorderonce to ensure that the system screenshot save path is in the current user's ~/Pictures/Screenshots, and the directory is empty
Start Testing Function
-
In the previous practical lesson, we obtained the Linyaps installation package
org.qbittorrent.qBittorrent_4.6.7.22_x86_64_binary.layerforqBittorrent--4.6.7. For convenience in demonstrating the suite's batch support capability, I separately found another installation package here -
Now we have two Linyaps application installation packages. First execute the
linyaps-auto-optimize.shscript to organize the directory This script mainly uses two parameters to point to the current directory storing Linyaps application installation packagesbinary.layer$ll_origin_pooland the destination directory that needs to be organized$ll_stored_pool -
I created two separate directories
ll-binsll-poollocally to point to$ll_origin_pooland$ll_stored_poolThe current directory structure ofll-bins:
├── ll-bins
│ ├── org.qbittorrent.qBittorrent_4.6.7.22_x86_64_binary.layer
│ └── com.poki.apple-knight-golf.linyaps_28.3.3.2_x86_64_binary.layer
- Execute directory organization operation
ziggy@linyaps23:/media/szbt/Data/linyaps-testing-toolchains$ ./linyaps-auto-optimize.sh ./ll-bins ./ll-pool
After the organization is completed, the directory presents this structure:
ll-pool/
├── org.qbittorrent.qBittorrent
│ └── package
│ └── org.qbittorrent.qBittorrent_4.6.7.22_x86_64_binary.layer
└── com.poki.apple-knight-golf.linyaps
└── package
└── com.poki.apple-knight-golf.linyaps_28.3.3.2_x86_64_binary.layer
- After the directory organization, two tables
ll-pkg-name.csvll-pkg-version.csvare generated to record application information. We merge the two columns into a new tablell-pkg-info.csv:
ll-pkg-info.csv
org.qbittorrent.qBittorrent,4.6.7.22
com.poki.apple-knight-golf.linyaps,28.3.3.2
- Based on this file, we can start batch installing Linyaps applications
This script mainly uses one parameter to point to the current organized destination directory
$ll_stored_pool:
ziggy@linyaps23:/media/szbt/Data/linyaps-testing-toolchains$ linyaps-auto-install-release.sh ./ll-pool
-
After installing the Linyaps applications and completing all prerequisite work, we can start the testing process. Here we create a new
resdirectory to store test result resources such as icons and screenshots -
Open a terminal in the graphical interface and execute the screenshot script. Since we are in a
deepin 23 x11environment and have installed the necessary programs, we runlinyaps-auto-screenshot-deepin23.shThis script mainly uses two parameters to point to the directory for placing test result resources$ll_res_pooland the table recording application information$ll_pkgname_list. Here it refers to the new tablell-pkg-info.csvwe obtained in the previous step:
ziggy@linyaps23:/media/szbt/Data/linyaps-testing-toolchains$ ./linyaps-auto-screenshot-deepin23.sh ./res ./ll-pkg-info.csv
* Remember, this script must be executed in a graphical terminal, otherwise the process cannot be properly launched
- After the script starts, minimize the terminal window and keep it running in the background. The testing suite will judge the application installation status and desktop file existence status to
startandcloseapplication windows
- After meeting the running requirements, the suite will simulate launching the program through the desktop file and judge the window after about 30s delay, checking whether the application generates a new window after running
-
After the application runs successfully, it will complete screenshot, icon detection & acquisition operations in sequence
-
After the test is completed, you can see tables of different statuses and test result materials in the
resdirectory. Since both applications here passed the compatibility test, they will be recorded inall-good.csvOtherwise, two abnormal situations will occur: a. Applications that timeout without generating windows will be written into thefailed.csvfile, judged as applications that cannot be launched b. If the Linyaps application directory does not contain icon files, it will be written into theicons-missing.csvfile, not meeting the specifications for graphical applications in the Linyaps community
res/
├── all-good.csv
├── com.poki.apple-knight-golf.linyaps
│ ├── icons
│ │ └── com.poki.apple-knight-golf.png ##Application icon file
│ └── screenshots ##Application compatibility test screenshots
│ ├── 1.png
│ ├── 2.png
│ └── 3.png
└── org.qbittorrent.qBittorrent
├── icons
│ ├── qbittorrent.png
│ └── qbittorrent.svg
└── screenshots
├── 1.png
├── 2.png
└── 3.png
So far, we have successfully completed compatibility testing of Linyaps applications produced in previous lessons through the Linyaps Application Automated Testing Suite




