Skip to content

Commit d0047b7

Browse files
authored
Merge pull request #38 from Greewil/tests
Tests
2 parents ce3a37a + c4d4552 commit d0047b7

File tree

15 files changed

+893
-29
lines changed

15 files changed

+893
-29
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,22 @@ assignees: ''
77

88
---
99

10+
## Problem
11+
1012
**Describe the bug**
13+
1114
A clear and concise description of what the bug is.
1215

1316
**To Reproduce**
17+
1418
Steps to reproduce the behavior:
1519
1. Go to '...'
1620
2. Click on '....'
1721
3. Scroll down to '....'
1822
4. See error
1923

20-
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
22-
2324
**Screenshots**
25+
2426
If applicable, add screenshots to help explain your problem.
2527

2628
**Desktop (please complete the following information):**
@@ -35,4 +37,10 @@ If applicable, add screenshots to help explain your problem.
3537
- Version [e.g. 22]
3638

3739
**Additional context**
40+
3841
Add any other context about the problem here.
42+
43+
## Expected behavior
44+
45+
A clear and concise description of what you expected to happen.
46+

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,22 @@ assignees: ''
77

88
---
99

10+
## Problem
11+
1012
**Is your feature request related to a problem? Please describe.**
13+
1114
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1215

16+
**Additional context**
17+
18+
Add any other context or screenshots about the feature request here.
19+
20+
## Possible solutions
21+
1322
**Describe the solution you'd like**
23+
1424
A clear and concise description of what you want to happen.
1525

1626
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
1827

19-
**Additional context**
20-
Add any other context or screenshots about the feature request here.
28+
A clear and concise description of any alternative solutions or features you've considered.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Installer tests
2+
3+
on: [workflow_call]
4+
5+
jobs:
6+
7+
installer-tests:
8+
name: Installer tests
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Installer tests
14+
working-directory: 'installer-tests'
15+
run: |
16+
./run_tests.sh ds 'installation-test' || exit 1
17+
- name: Autoupdate tests
18+
working-directory: 'installer-tests'
19+
run: |
20+
./run_tests.sh ds 'autoupdate-test' || exit 1

.github/workflows/quality-assurance.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ on: [workflow_call]
44

55
jobs:
66

7-
quality-assurance:
8-
name: Quality Assurance
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v4
13-
- name: Lint
14-
uses: azohra/shell-linter@latest
15-
with:
16-
path: "vuh.sh,vuh-completion.sh,installer.sh"
7+
unit-tests:
8+
name: Unit tests
9+
uses: ./.github/workflows/unit-tests.yml
10+
11+
shellcheck:
12+
name: Shellcheck
13+
uses: ./.github/workflows/shellcheck.yml
14+
15+
installer-tests:
16+
name: Installer tests
17+
uses: ./.github/workflows/installer-tests.yml

.github/workflows/shellcheck.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Shellcheck
2+
3+
on: [workflow_call]
4+
5+
jobs:
6+
7+
shellcheck:
8+
name: Shellcheck
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Lint
14+
uses: azohra/shell-linter@latest
15+
with:
16+
path: "vuh.sh,vuh-completion.sh,installer.sh,unit-tests/run_tests.sh,unit-tests/_clean_tmp.sh,installer-tests/run_tests.sh"

.github/workflows/unit-tests.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Unit tests
2+
3+
on: [workflow_call]
4+
5+
jobs:
6+
7+
unit-tests:
8+
name: Unit tests
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
test_group: ['bo', 'ci', 'sv', 'cc', 'mr', 'mmo', 'nrd', 'cgd', 'cgdmr', 'of', 'ae']
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Unit tests
17+
working-directory: 'unit-tests'
18+
run: |
19+
./run_tests.sh -q -tp ${{ matrix.test_group }} || exit 1

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# temporary test files
2+
tmp
3+
14
#idea files
25
.idea
36

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ vuh sv
320320
vuh sv -pm=YOUR_PROJECT_MODULE # in case you have monorepository with multiple modules
321321
```
322322

323-
[//]: # (TODO link to example js repo, python repo, java repo, ...)
324-
[//]: # (TODO link to example monorepo, f.e. with WEB, BACKEND, OPENAPI_SCHEMA)
323+
[//]: # (TODO link to example js branches, python branches, java branches, ...)
324+
[//]: # (TODO link to example monorepo branche, f.e. with WEB, BACKEND, OPENAPI_SCHEMA)
325325

326326
## Version comparing logic
327327

installer-tests/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM ubuntu:latest
2+
3+
RUN set -xe \
4+
&& apt-get update \
5+
&& apt-get install -y git expect curl unzip
6+
7+
COPY run_tests.sh autoupdate.exp ./
8+
9+
ENV TESTS_COMMANDS='installation-test'
10+
11+
CMD ./run_tests.sh ${TESTS_COMMANDS}

installer-tests/autoupdate.exp

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/expect -f
2+
#
3+
# This Expect script was generated by autoexpect on Sun May 25 21:05:05 2025
4+
# Expect and autoexpect were both written by Don Libes, NIST.
5+
#
6+
# Note that autoexpect does not guarantee a working script. It
7+
# necessarily has to guess about certain things. Two reasons a script
8+
# might fail are:
9+
#
10+
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet,
11+
# etc.) and devices discard or ignore keystrokes that arrive "too
12+
# quickly" after prompts. If you find your new script hanging up at
13+
# one spot, try adding a short sleep just before the previous send.
14+
# Setting "force_conservative" to 1 (see below) makes Expect do this
15+
# automatically - pausing briefly before sending each character. This
16+
# pacifies every program I know of. The -c flag makes the script do
17+
# this in the first place. The -C flag allows you to define a
18+
# character to toggle this mode off and on.
19+
20+
set force_conservative 0 ;# set to 1 to force conservative mode even if
21+
;# script wasn't run conservatively originally
22+
if {$force_conservative} {
23+
set send_slow {1 .1}
24+
proc send {ignore arg} {
25+
sleep .1
26+
exp_send -s -- $arg
27+
}
28+
}
29+
30+
#
31+
# 2) differing output - Some programs produce different output each time
32+
# they run. The "date" command is an obvious example. Another is
33+
# ftp, if it produces throughput statistics at the end of a file
34+
# transfer. If this causes a problem, delete these patterns or replace
35+
# them with wildcards. An alternative is to use the -p flag (for
36+
# "prompt") which makes Expect only look for the last line of output
37+
# (i.e., the prompt). The -P flag allows you to define a character to
38+
# toggle this mode off and on.
39+
#
40+
# Read the man page for more info.
41+
#
42+
# -Don
43+
44+
45+
set timeout -1
46+
spawn vuh lv
47+
match_max 100000
48+
expect -exact "\[0;33m(vuh : INPUT) Do you want to get update? (Y/N): \[0m"
49+
send -- "y\r"
50+
expect eof

0 commit comments

Comments
 (0)