Skip to content
Closed
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
6 changes: 4 additions & 2 deletions .github/workflows/build-linux-installer-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,11 @@ jobs:
url: "docker://ubuntu:noble"
mode:
- name: GUI
matrix: gui
file: chia-blockchain_*.deb
package: chia-blockchain
- name: CLI
matrix: cli
file: chia-blockchain-cli_*.deb
package: chia-blockchain-cli
arch:
Expand Down Expand Up @@ -423,7 +425,7 @@ jobs:

- name: Run chia dev installers test
run: |
chia dev installers test --expected-chia-version "${{ needs.build.outputs.chia-installer-version }}"
chia dev installers test --expected-chia-version "${{ needs.build.outputs.chia-installer-version }}" ${{ matrix.mode.matrix == 'gui' && '--gui-command chia-blockchain' || '' }}

- name: Verify /opt/chia present
run: |
Expand All @@ -435,7 +437,7 @@ jobs:

- name: Check permissions of /opt/chia/chrome-sandbox
shell: bash
if: matrix.mode.name == 'GUI'
if: matrix.mode.matrix == 'gui'
run: |
[ $(stat -c %a:%G:%U /opt/chia/chrome-sandbox) == "4755:root:root" ]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-linux-installer-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ jobs:

- name: Run chia dev installers test
run: |
chia dev installers test --require-no-madmax --expected-chia-version "${{ needs.build.outputs.chia-installer-version }}"
chia dev installers test --require-no-madmax --expected-chia-version "${{ needs.build.outputs.chia-installer-version }}" ${{ matrix.mode.matrix == 'gui' && '--gui-command chia-blockchain' || '' }}

- name: Verify /opt/chia present
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-macos-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ jobs:

- name: Run chia dev installers test
run: |
"/Volumes/Chia "*"/Chia.app/Contents/Resources/app.asar.unpacked/daemon/chia" dev installers test --expected-chia-version "${{ needs.build.outputs.chia-installer-version }}"
"/Volumes/Chia "*"/Chia.app/Contents/Resources/app.asar.unpacked/daemon/chia" dev installers test --expected-chia-version "${{ needs.build.outputs.chia-installer-version }}" --gui-command "/Volumes/Chia "*/Chia.app/Contents/MacOS/Chia

- name: Detach .dmg
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,4 @@ jobs:
env:
INSTALL_PATH: ${{ github.workspace }}\installed
run: |
& ($env:INSTALL_PATH + "\resources\app.asar.unpacked\daemon\chia.exe") dev installers test --expected-chia-version "${{ needs.build.outputs.chia-installer-version }}"
& ($env:INSTALL_PATH + "\resources\app.asar.unpacked\daemon\chia.exe") dev installers test --expected-chia-version "${{ needs.build.outputs.chia-installer-version }}" --gui-command ($env:INSTALL_PATH + "\Chia.exe")
22 changes: 20 additions & 2 deletions chia/cmds/installers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import json
import subprocess
import sys
import tempfile
from typing import Dict, List, Optional
from typing import Dict, List, Optional, Sequence

import click
import packaging.version
Expand Down Expand Up @@ -50,7 +51,8 @@ def installers_group() -> None:
@installers_group.command(name="test")
@click.option("--expected-chia-version", "expected_chia_version_str", required=True)
@click.option("--require-madmax/--require-no-madmax", "require_madmax", default=True)
def test_command(expected_chia_version_str: str, require_madmax: bool) -> None:
@click.option("--gui-command", multiple=True)
def test_command(expected_chia_version_str: str, require_madmax: bool, gui_command: Sequence[str]) -> None:
print("testing installed executables")
expected_chia_version = packaging.version.Version(expected_chia_version_str)

Expand Down Expand Up @@ -127,3 +129,19 @@ def test_command(expected_chia_version_str: str, require_madmax: bool) -> None:
check=True,
timeout=adjusted_timeout(30),
)

if len(gui_command) == 0:
print("skipping gui launch test")
else:
print(f"launching: {gui_command}")
sys.stdout.flush()
try:
subprocess.run(
args=gui_command,
check=True,
timeout=adjusted_timeout(30),
)
except subprocess.TimeoutExpired:
pass
else:
raise Exception("process terminated prior to timeout")