-
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #602 from yorukot/testsuite_action
Testsuite in github actions
- Loading branch information
Showing
17 changed files
with
298 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Python Testsuite Run | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install tmux | ||
run: sudo apt-get update && sudo apt-get install -y tmux | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22.2 | ||
- name: Build superfile | ||
run: ./build.sh | ||
|
||
# timeout command just launches and kills spf, to create the config directories | ||
- name: Check installation | ||
run: tmux -V; ls; pwd; ls bin/; bin/spf path-list; timeout 1s bin/spf | ||
continue-on-error: true | ||
- name: set debug | ||
run: sed -i 's/debug = false/debug = true/g' /home/runner/.config/superfile/config.toml | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install Dependencies | ||
run: pip install -r testsuite/requirements.txt | ||
|
||
- name: Run Tests | ||
run: python testsuite/main.py -d | ||
|
||
- name: Print logs | ||
if: always() | ||
run: cat ~/.local/state/superfile/superfile.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import pyperclip | ||
# ------ Clipboard utils | ||
|
||
# This creates a layer of abstraction. | ||
# Now the user of the fuction doesn't need to import pyperclip | ||
# or need to even know what pyperclip was used. | ||
def get_sys_clipboard_text() -> str : | ||
return pyperclip.paste() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
pyautogui | ||
libtmux | ||
pyautogui; sys_platform == "windows" | ||
libtmux; sys_platform == "linux" or sys_platform == "darwin" | ||
pyperclip | ||
assertpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from pathlib import Path | ||
|
||
from core.base_test import GenericTestImpl | ||
from core.environment import Environment | ||
import core.keys as keys | ||
|
||
TESTROOT = Path("cmd_ops") | ||
DIR1 = TESTROOT / "dir1" | ||
FILE1 = TESTROOT / "file1" | ||
|
||
class CommandTest(GenericTestImpl): | ||
"""Test compression and extraction | ||
""" | ||
def __init__(self, test_env : Environment): | ||
super().__init__( | ||
test_env=test_env, | ||
test_root=TESTROOT, | ||
start_dir=TESTROOT, | ||
test_dirs=[TESTROOT], | ||
key_inputs=[':', 'mkdir dir1', keys.KEY_ENTER, ':', 'touch file1', keys.KEY_ENTER], | ||
validate_exists=[DIR1, FILE1] | ||
) |
Oops, something went wrong.