Skip to content

Commit 2797deb

Browse files
committed
use -cli only for e2e testing on all platforms
1 parent 1ccd7a3 commit 2797deb

File tree

3 files changed

+33
-19
lines changed

3 files changed

+33
-19
lines changed

.github/workflows/test.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,28 @@ jobs:
5656
- name: Run unit tests
5757
run: task test-unit
5858

59-
- name: Build the Agent for linux
60-
run: task build
61-
if: matrix.os == 'ubuntu-18.04'
62-
63-
# build the agent without GUI support (no tray icon)
59+
# build the agent without GUI support (no tray icon) for e2e testing
6460
- name: Build the Agent-cli
6561
run: task build-cli
62+
if: matrix.os != 'windows-2019'
63+
64+
- name: Build the Agent-cli for win
65+
run: task build-win-cli
66+
if: matrix.os == 'windows-2019'
67+
68+
- name: Install Python
69+
uses: actions/setup-python@v2
70+
with:
71+
python-version: '3.9'
72+
architecture: 'x64'
73+
74+
- name: Run e2e tests
75+
run: |
76+
pip install poetry
77+
task test-e2e
78+
79+
- name: Build the Agent for linux
80+
run: task build
6681
if: matrix.os == 'ubuntu-18.04'
6782

6883
# the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28)
@@ -91,25 +106,13 @@ jobs:
91106
run: task build
92107
if: matrix.os == 'macos-10.15'
93108

94-
- name: Install Python
95-
uses: actions/setup-python@v2
96-
with:
97-
python-version: '3.9'
98-
architecture: 'x64'
99-
if: matrix.os == 'macos-10.15'
100-
101-
- name: Run e2e tests
102-
run: |
103-
pip install poetry
104-
task test-e2e
105-
if: matrix.os == 'macos-10.15'
106-
107109
# config.ini is required by the executable when it's run
108110
- name: Upload artifacts
109111
uses: actions/upload-artifact@v2
110112
with:
111113
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
112114
path: |
115+
!arduino-create-agent_cli*
113116
arduino-create-agent*
114117
config.ini
115118
if-no-files-found: error

Taskfile.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ tasks:
2828
WIN_FLAGS: -H=windowsgui
2929
- rm *.syso # rm file to avoid compilation problems on other platforms
3030

31+
build-win-cli:
32+
desc: Build the project without tray support
33+
cmds:
34+
- task: build
35+
vars:
36+
APP_NAME: arduino-create-agent_cli.exe
37+
ADDITIONAL_FLAGS: -tags cli
38+
3139
test-unit:
3240
desc: Run unit tests only
3341
cmds:

test/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@pytest.fixture(scope="function")
1313
def agent(pytestconfig):
1414

15-
agent_cli = str(Path(pytestconfig.rootdir) / "arduino-create-agent")
15+
agent_cli = str(Path(pytestconfig.rootdir) / "arduino-create-agent_cli")
1616
env = {
1717
# "ARDUINO_DATA_DIR": data_dir,
1818
# "ARDUINO_DOWNLOADS_DIR": downloads_dir,
@@ -23,6 +23,9 @@ def agent(pytestconfig):
2323
runner = Local(run_context) # execute a command on the local filesystem
2424

2525
cd_command = "cd"
26+
if platform.system() == "Windows":
27+
cd_command += " /d"
28+
2629
with run_context.prefix(f'{cd_command} ..'):
2730
runner.run(agent_cli, echo=True, hide=True, warn=True, env=env, asynchronous=True)
2831

0 commit comments

Comments
 (0)