Compare commits

..

2 Commits

Author SHA1 Message Date
yureiblack
128880988e test: correct typo in node-spec.ts comment (#49141)
fix: correct typo in node-spec.ts comment
2026-02-25 23:03:06 -08:00
Shelley Vohr
8d05285a1f fix: potential std::stoi crash in Windows Toasts (#49947)
fix: potential std::stoi crash in Windows Toasts
2026-02-25 14:14:45 -08:00
6 changed files with 2 additions and 208 deletions

View File

@@ -125,18 +125,6 @@ jobs:
test-container: ${{ inputs.test-container }}
display-server: wayland
secrets: inherit
test-linux-64k:
uses: ./.github/workflows/pipeline-segment-electron-test-64k.yml
permissions:
contents: read
issues: read
pull-requests: read
needs: build
if: ${{ inputs.target-platform == 'linux' && inputs.target-arch == 'arm64' && !inputs.is-asan }}
with:
test-runs-on: ${{ inputs.test-runs-on }}
test-container: ${{ inputs.test-container }}
secrets: inherit
nn-test:
uses: ./.github/workflows/pipeline-segment-node-nan-test.yml
permissions:

View File

@@ -1,64 +0,0 @@
name: Pipeline Segment - Electron Test on Linux ARM64 64k
on:
workflow_call:
inputs:
test-runs-on:
type: string
description: 'What host to run the tests on'
required: true
test-container:
type: string
description: 'JSON container information for aks runs-on'
required: false
default: '{"image":null}'
concurrency:
group: electron-test-linux-64k-${{ github.ref_protected == true && github.run_id || github.ref }}
cancel-in-progress: ${{ github.ref_protected != true }}
permissions: {}
env:
ELECTRON_OUT_DIR: Default
jobs:
test-linux-arm64-64k:
defaults:
run:
shell: bash
runs-on: ${{ inputs.test-runs-on }}
permissions:
contents: read
issues: read
pull-requests: read
steps:
- name: Download Generated Artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: generated_artifacts_linux_arm64
path: ./generated_artifacts_linux_arm64
- name: Download Src Artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: src_artifacts_linux_arm64
path: ./src_artifacts_linux_arm64
- name: Restore Generated Artifacts
run: ./src/electron/script/actions/restore-artifacts.sh
- name: Unzip Dist
run: |
cd src/out/Default
unzip -:o dist.zip
- name: Run Electron Tests in QEMU 64k Container
shell: bash
env:
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_MULTI_REPORTERS: mocha-junit-reporter, tap
ELECTRON_DISABLE_SECURITY_WARNINGS: 1
DISPLAY: ':99.0'
run: |
container=$(echo '${{ inputs.test-container }}' | jq -r '.image')
echo "Running tests in container: $container"
src/electron/script/run-qemu-64k.sh --container="$container" --testfiles=`pwd`/src

View File

@@ -1,41 +0,0 @@
#!/bin/sh
echo "Mounting essential filesystems"
mount -t proc proc /proc
mount -t sysfs sys /sys
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
mkdir -p /dev/shm
mount -t tmpfs tmpfs /dev/shm
mount -t tmpfs tmpfs /tmp
chmod 1777 /tmp
mount -t tmpfs tmpfs /run
mkdir -p /run/dbus
mkdir -p /run/user/0
chmod 700 /run/user/0
mount -t tmpfs tmpfs /var/tmp
echo "Setting up machine-id for D-Bus"
cat /proc/sys/kernel/random/uuid | tr -d '-' > /etc/machine-id
echo "Setting system clock"
date -s "$(cat /host-time)"
echo "Setting up networking"
ip link set lo up
ip link set eth0 up
ip addr add 10.0.2.15/24 dev eth0
ip route add default via 10.0.2.2
echo "nameserver 10.0.2.3" > /etc/resolv.conf
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export XDG_RUNTIME_DIR=/run/user/0
echo "Starting entrypoint"
echo "System: $(uname -s) $(uname -r) $(uname -m), page size: $(getconf PAGESIZE) bytes"
EXIT_CODE=$?
echo $EXIT_CODE > /exit-code
sync
echo "Powering off"
echo o > /proc/sysrq-trigger

View File

@@ -1,89 +0,0 @@
#!/bin/sh
set -e
CONTAINER=""
TESTFILES=""
ARGS=""
while [ $# -gt 0 ]; do
case "$1" in
--container) CONTAINER="$2"; shift 2 ;;
--testfiles) TESTFILES="$2"; shift 2 ;;
--) shift; ARGS="$*"; break ;;
*) echo "Unknown option: $1"; exit 1 ;;
esac
done
if [ -z "$CONTAINER" ]; then
echo "Usage: $0 --container CONTAINER [-- ARGS...]"
exit 1
fi
echo "Installing QEMU system emulation and tools"
sudo apt-get update && sudo apt-get install -y qemu-system-arm binutils
echo "Exporting container filesystem"
CONTAINER_ID=$(docker create --platform linux/arm64 "$CONTAINER")
ROOTFS_DIR=$(mktemp -d)
docker export "$CONTAINER_ID" | sudo tar -xf - -C "$ROOTFS_DIR"
docker rm -f "$CONTAINER_ID"
echo "Removing container image to free disk space"
docker rmi "$CONTAINER" || true
docker system prune -f || true
echo "Copying test files into root filesystem"
if [ -n "$TESTFILES" ]; then
sudo cp -r $TESTFILES "$ROOTFS_DIR/root/"
fi
echo "Downloading Ubuntu 24.04 generic-64k kernel for ARM64"
KERNEL_URL="http://ports.ubuntu.com/ubuntu-ports/pool/main/l/linux/linux-image-unsigned-6.8.0-90-generic-64k_6.8.0-90.91_arm64.deb"
KERNEL_DIR=$(mktemp -d)
curl -fL "$KERNEL_URL" -o "$KERNEL_DIR/kernel.deb"
echo "Extracting kernel"
(cd "$KERNEL_DIR" && ar x kernel.deb && tar xf data.tar*)
VMLINUZ="$KERNEL_DIR/boot/vmlinuz-6.8.0-90-generic-64k"
if [ ! -f "$VMLINUZ" ]; then
echo "Error: Could not find kernel at $VMLINUZ"
exit 1
fi
echo "Storing test arguments and installing init script"
echo "$ARGS" > "$ROOTFS_DIR/test-args"
date -u '+%Y-%m-%d %H:%M:%S' > "$ROOTFS_DIR/host-time"
sudo mv "$ROOTFS_DIR/root/electron/scripts/qemu-init.sh" "$ROOTFS_DIR/init"
sudo chmod +x "$ROOTFS_DIR/init"
echo "Creating disk image with root filesystem"
DISK_IMG=$(mktemp)
dd if=/dev/zero of="$DISK_IMG" bs=1M count=2048 status=none
sudo mkfs.ext4 -q -d "$ROOTFS_DIR" "$DISK_IMG"
sudo rm -rf "$ROOTFS_DIR"
echo "Starting QEMU VM with 64K page size kernel"
timeout 1800 qemu-system-aarch64 \
-M virt \
-cpu max,pauth-impdef=on \
-accel tcg,thread=multi \
-m 4096 \
-smp 2 \
-kernel "$VMLINUZ" \
-append "console=ttyAMA0 root=/dev/vda rw init=/init net.ifnames=0" \
-drive file="$DISK_IMG",format=raw,if=virtio \
-netdev user,id=net0 \
-device virtio-net-pci,netdev=net0 \
-nographic \
-no-reboot \
|| true
echo "Extracting test results from disk image"
MOUNT_DIR=$(mktemp -d)
sudo mount -o loop "$DISK_IMG" "$MOUNT_DIR"
if [ -f "$MOUNT_DIR/root/results.xml" ]; then
cp "$MOUNT_DIR/root/results.xml" "$TEST_DIR/results.xml"
fi
EXIT_CODE=$(cat "$MOUNT_DIR/exit-code" 2>/dev/null || echo 1)
sudo umount "$MOUNT_DIR"
exit $EXIT_CODE

View File

@@ -371,7 +371,7 @@ void HandleToastActivation(const std::wstring& invoked_args,
int action_index = -1;
if (!action_index_str.empty()) {
action_index = std::stoi(action_index_str);
base::StringToInt(base::WideToUTF8(action_index_str), &action_index);
}
std::string reply_text;

View File

@@ -28,7 +28,7 @@ describe('node feature', () => {
expect(msg).to.equal('message');
});
it('Has its module searth paths restricted', async () => {
it('Has its module search paths restricted', async () => {
const child = childProcess.fork(path.join(fixtures, 'module', 'module-paths.js'));
const [msg] = await once(child, 'message');
expect(msg.length).to.equal(2);