Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/test_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ jobs:
with:
node-version: "20"

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Download artifacts
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -84,7 +89,7 @@ jobs:
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: |
sudo apt-get update
sudo apt-get install -y git wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0-dev libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0 python3 python3-venv python3-pip
sudo apt-get install -y git wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0-dev libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0

- name: Install dependencies (MacOS)
if: matrix.os == 'macos-latest' || matrix.os == 'macos-15-intel'
Expand All @@ -94,6 +99,7 @@ jobs:
- name: Run IDF basic install test script (non-Windows)
if: matrix.os != 'windows-latest' && matrix.run_on != 'MirrorRunner'
run: |
python3 --version
export LOG_TO_FILE="true"
export PACKAGE_NAME="${{ matrix.package_name }}"
export EIM_CLI_PATH="../artifacts/eim"
Expand All @@ -106,6 +112,7 @@ jobs:
- name: Run IDF extended install test script (non-Windows)
if: matrix.os != 'windows-latest' && matrix.run_on != 'MirrorRunner' && matrix.run_on !='ExtraRunner' && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'EXTENDEDTEST')
run: |
python3 --version
export LOG_TO_FILE="true"
export PACKAGE_NAME="${{ matrix.package_name }}"
export EIM_CLI_PATH="../artifacts/eim"
Expand All @@ -117,6 +124,7 @@ jobs:
- name: Run mirrors basic test script (MirrorRunner)
if: matrix.run_on == 'MirrorRunner'
run: |
python3 --version
export LOG_TO_FILE="true"
export PACKAGE_NAME="${{ matrix.package_name }}"
export EIM_CLI_PATH="../artifacts/eim"
Expand All @@ -129,6 +137,7 @@ jobs:
- name: Run mirrors extended test script (MirrorRunner)
if: matrix.run_on == 'MirrorRunner' && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'EXTENDEDTEST')
run: |
python3 --version
export LOG_TO_FILE="true"
export PACKAGE_NAME="${{ matrix.package_name }}"
export EIM_CLI_PATH="../artifacts/eim"
Expand Down Expand Up @@ -162,6 +171,7 @@ jobs:
- name: Run IDF basic install test script (Windows)
if: matrix.os == 'windows-latest'
run: |
python3 --version
$env:LOG_TO_FILE="true"
$env:PACKAGE_NAME="${{ matrix.package_name }}"
$env:EIM_CLI_PATH = "..\artifacts\eim.exe"
Expand All @@ -174,6 +184,7 @@ jobs:
- name: Run IDF extended install test script (Windows)
if: matrix.os == 'windows-latest' && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'EXTENDEDTEST')
run: |
python3 --version
$env:LOG_TO_FILE="true"
$env:PACKAGE_NAME="${{ matrix.package_name }}"
$env:EIM_CLI_PATH = "..\artifacts\eim.exe"
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/test_gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ jobs:
with:
node-version: "20"

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Download artifacts
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -83,11 +88,12 @@ jobs:
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: |
sudo apt-get update
sudo apt-get install -y git wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0-dev libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0 python3 python3-venv python3-pip webkit2gtk-driver
sudo apt-get install -y git wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0-dev libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0 webkit2gtk-driver

- name: Run IDF basic install test script (Ubuntu)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: |
python3 --version
export LOG_TO_FILE="true"
export PACKAGE_NAME="${{ matrix.package_name }}"
export EIM_CLI_PATH="../artifacts/eim"
Expand All @@ -113,6 +119,7 @@ jobs:
- name: Run IDF basic install test script (MacOS)
if: matrix.os == 'macos-latest' || matrix.os == 'macos-15-intel'
run: |
python3 --version
export LOG_TO_FILE="true"
export PACKAGE_NAME="${{ matrix.package_name }}"
export EIM_CLI_PATH="../artifacts/eim.app/Contents/MacOS/eim"
Expand Down Expand Up @@ -146,6 +153,7 @@ jobs:
- name: Run IDF basic install test script (Windows)
if: matrix.os == 'windows-latest'
run: |
python3 --version
$env:LOG_TO_FILE="true"
$env:PACKAGE_NAME="${{ matrix.package_name }}"
$env:EIM_CLI_PATH = "..\artifacts\eim.exe"
Expand Down Expand Up @@ -232,6 +240,11 @@ jobs:
with:
node-version: "20"

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Install Tauri-Driver
run: |
cargo install tauri-driver
Expand Down Expand Up @@ -266,7 +279,7 @@ jobs:
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: |
sudo apt-get update
sudo apt-get install -y git wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0-dev libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0 python3 python3-venv python3-pip webkit2gtk-driver xvfb
sudo apt-get install -y git wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0-dev libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0 webkit2gtk-driver xvfb

- name: Start XVFB (Ubuntu)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
Expand All @@ -277,6 +290,7 @@ jobs:
- name: Run IDF basic install test script using GUI (non-Windows)
if: matrix.os != 'windows-latest'
run: |
python3 --version
export LOG_TO_FILE="true"
export PACKAGE_NAME="${{ matrix.package_name }}"
export EIM_GUI_PATH="../artifacts/eim"
Expand All @@ -289,6 +303,7 @@ jobs:
- name: Run IDF extended install test script using GUI (non-Windows)
if: matrix.os != 'windows-latest' && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'EXTENDEDTEST')
run: |
python3 --version
export LOG_TO_FILE="true"
export PACKAGE_NAME="${{ matrix.package_name }}"
export EIM_GUI_PATH="../artifacts/eim"
Expand Down Expand Up @@ -328,6 +343,7 @@ jobs:
- name: Run IDF basic install test script using GUI (Windows)
if: matrix.os == 'windows-latest'
run: |
python3 --version
$env:LOG_TO_FILE="true"
$env:PACKAGE_NAME="${{ matrix.package_name }}"
$env:EIM_GUI_PATH = "..\artifacts\eim.exe"
Expand All @@ -340,6 +356,7 @@ jobs:
- name: Run IDF extended install test script using GUI (Windows)
if: matrix.os == 'windows-latest' && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'EXTENDEDTEST')
run: |
python3 --version
$env:LOG_TO_FILE="true"
$env:PACKAGE_NAME="${{ matrix.package_name }}"
$env:EIM_GUI_PATH = "..\artifacts\eim.exe"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/test_offline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ jobs:
with:
node-version: "20"

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Download Build Info files
uses: actions/download-artifact@v5
with:
Expand Down Expand Up @@ -101,7 +106,7 @@ jobs:
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: |
sudo apt-get update
sudo apt-get install -y git wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0-dev libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0 python3 python3-pip python3-venv
sudo apt-get install -y git wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0-dev libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0
python3 --version
cd tests
npm ci
Expand Down
21 changes: 15 additions & 6 deletions tests/CLIRunner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function testRun(jsonScript) {
describe(`Test${test.id}- ${test.name} |`, function () {
this.timeout(20000);

runCLIPrerequisitesTest({ id: `${test.id}1`, pathToEim: pathToEIMCLI });
runCLIPrerequisitesTest({ id: `${test.id}1`, pathToEIM: pathToEIMCLI });
});
} else if (test.type === "arguments") {
//routine for arguments tests
Expand All @@ -73,7 +73,7 @@ function testRun(jsonScript) {

runCLIArgumentsTest({
id: `${test.id}1`,
pathToEim: pathToEIMCLI,
pathToEIM: pathToEIMCLI,
eimVersion: EIMCLIVersion,
});
});
Expand All @@ -88,7 +88,7 @@ function testRun(jsonScript) {

runCLIWizardInstallTest({
id: `${test.id}1`,
pathToEim: pathToEIMCLI,
pathToEIM: pathToEIMCLI,
testProxyMode,
});

Expand Down Expand Up @@ -153,7 +153,7 @@ function testRun(jsonScript) {

runCLICustomInstallTest({
id: `${test.id}1`,
pathToEim: pathToEIMCLI,
pathToEIM: pathToEIMCLI,
args: installArgs,
testProxyMode,
});
Expand Down Expand Up @@ -187,15 +187,24 @@ function testRun(jsonScript) {
? path.join(os.homedir(), test.data.installFolder)
: INSTALLFOLDER;

const deleteAfterTest = test.deleteAfterTest ?? true;

describe(`Test${test.id}- ${test.name} |`, function () {
this.timeout(60000);

runVersionManagementTest({
id: `${test.id}1`,
pathToEim: pathToEIMCLI,
pathToEIM: pathToEIMCLI,
idfList: idfUpdatedList,
installFolder,
});

runCleanUp({
id: `${test.id}3`,
installFolder,
toolsFolder: TOOLSFOLDER,
deleteAfterTest,
});
});
} else if (test.type === "offline") {
//routine for offline installation test
Expand All @@ -207,7 +216,7 @@ function testRun(jsonScript) {

runCLICustomInstallTest({
id: `${test.id}1`,
pathToEim: pathToEIMCLI,
pathToEIM: pathToEIMCLI,
offlineIDFVersion: IDFDefaultVersion,
offlinePkgName: pkgName,
testProxyMode,
Expand Down
34 changes: 34 additions & 0 deletions tests/GUIRunner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { runGUICustomInstallTest } from "./scripts/GUICustomInstall.test.js";
import { runInstallVerification } from "./scripts/installationVerification.test.js";
import { runGUIAfterInstallTest } from "./scripts/GUIAfterInstall.test.js";
import { runGUIOfflineInstallTest } from "./scripts/GUIOfflineInstall.test.js";
import { runGUIVersionManagementTest } from "./scripts/GUIVersionManagement.test.js";
import { runCleanUp } from "./scripts/cleanUpRunner.test.js";
import {
IDFDefaultVersion,
Expand Down Expand Up @@ -144,6 +145,39 @@ function testRun(script) {
toolsFolder: TOOLSFOLDER,
});

runCleanUp({
id: `${test.id}4`,
installFolder,
toolsFolder: TOOLSFOLDER,
deleteAfterTest,
});
});
} else if (test.type === "version-management") {
//routine for version management tests
const idfVersionList = test.data.idfList
? test.data.idfList.split("|")
: [IDFDefaultVersion];

const idfUpdatedList = idfVersionList.map((idf) =>
idf === "default" ? IDFDefaultVersion : idf
);

let installFolder = test.data.installFolder
? path.join(os.homedir(), test.data.installFolder)
: INSTALLFOLDER;
const deleteAfterTest = test.deleteAfterTest ?? true;

describe(`Test${test.id}- ${test.name} |`, function () {
this.timeout(60000);

runGUIVersionManagementTest({
id: `${test.id}1`,
pathToEIM: pathToEIMGUI,
idfList: idfUpdatedList,
installFolder,
toolsFolder: TOOLSFOLDER,
});

runCleanUp({
id: `${test.id}4`,
installFolder,
Expand Down
2 changes: 1 addition & 1 deletion tests/offlineRunner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function testRun(archiveInfo) {

runCLICustomInstallTest({
id: `11`,
pathToEim: pathToEIMCLI,
pathToEIM: pathToEIMCLI,
offlineIDFVersion: info.version,
offlinePkgName: info.platform,
testProxyMode: "block",
Expand Down
8 changes: 4 additions & 4 deletions tests/scripts/CLIArguments.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, it, before, after, beforeEach, afterEach } from "mocha";
import CLITestRunner from "../classes/CLITestRunner.class.js";
import logger from "../classes/logger.class.js";

export function runCLIArgumentsTest({ id = 0, pathToEim, eimVersion }) {
export function runCLIArgumentsTest({ id = 0, pathToEIM, eimVersion }) {
describe(`${id}- Basic Arguments |`, function () {
let testRunner = null;

Expand All @@ -29,15 +29,15 @@ export function runCLIArgumentsTest({ id = 0, pathToEim, eimVersion }) {
it("1- should show correct version number", async function () {
logger.info(`Starting test - show correct version`);
await testRunner.start();
testRunner.sendInput(`${pathToEim} -V`);
testRunner.sendInput(`${pathToEIM} -V`);
const meetVersion = await testRunner.waitForOutput(eimVersion, 15000);
expect(meetVersion, "EIM showing incorrect version number").to.be.true;
});

it("2- should show help with --help argument", async function () {
logger.info(`Starting test - show help`);
await testRunner.start();
testRunner.sendInput(`${pathToEim} --help`);
testRunner.sendInput(`${pathToEIM} --help`);
const printHelp = await testRunner.waitForOutput("Options:");
expect(printHelp, "EIM failed to print help options").to.be.true;
expect(testRunner.output, "EIM failed to print usage help").to.include(
Expand All @@ -48,7 +48,7 @@ export function runCLIArgumentsTest({ id = 0, pathToEim, eimVersion }) {
it("3- should handle invalid arguments", async function () {
logger.info(`Starting test - invalid argument`);
await testRunner.start();
testRunner.sendInput(`${pathToEim} --KK`);
testRunner.sendInput(`${pathToEIM} --KK`);
const wrongArgument = await testRunner.waitForOutput(
"unexpected argument"
);
Expand Down
16 changes: 9 additions & 7 deletions tests/scripts/CLICustomInstall.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import fs from "fs";

export function runCLICustomInstallTest({
id = 0,
pathToEim,
pathToEIM,
args = [],
offlineIDFVersion = null,
offlinePkgName = null,
Expand Down Expand Up @@ -71,11 +71,13 @@ export function runCLICustomInstallTest({
} finally {
testRunner = null;
}
try {
await proxy.stop();
} catch (error) {
logger.info("Error stopping proxy server");
logger.debug(`Error: ${error}`);
if (testProxyMode) {
try {
await proxy.stop();
} catch (error) {
logger.info("Error stopping proxy server");
logger.debug(`Error: ${error}`);
}
}
// Remove offline archive to save space in the runner
if (pathToOfflineArchive) {
Expand All @@ -96,7 +98,7 @@ export function runCLICustomInstallTest({

it("1- Should install IDF using specified parameters", async function () {
logger.info(`Starting test - IDF custom installation`);
testRunner.sendInput(`${pathToEim} install ${args.join(" ")}`);
testRunner.sendInput(`${pathToEIM} install ${args.join(" ")}`);
await new Promise((resolve) => setTimeout(resolve, 5000));
if (args.includes("-n false")) {
const startTime = Date.now();
Expand Down
Loading
Loading