Skip to content

Commit a4928f3

Browse files
authored
Merge pull request #200 from nicolasbock/functional
Add functional testing to CI
2 parents 1d879d0 + dd5d54a commit a4928f3

File tree

3 files changed

+66
-2
lines changed

3 files changed

+66
-2
lines changed

.github/workflows/functional.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Functional testing
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
functional_testing:
14+
runs-on: ubuntu-latest
15+
name: Functional testing
16+
steps:
17+
- name: Check out sources
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.10'
26+
27+
- name: Install
28+
run: |
29+
sudo apt install python3-pip
30+
sudo pip install -r requirements.txt
31+
python3 setup.py install
32+
33+
- name: Clone portage
34+
run: |
35+
pushd ${HOME}
36+
git clone --depth 1 https://github.com/gentoo/gentoo.git
37+
popd
38+
39+
- name: Docker info
40+
run: docker info
41+
42+
- name: Testbuild of `nano`
43+
run: |
44+
ebuildtester --portage-dir ~/gentoo \
45+
--rm \
46+
--pull \
47+
--ccache /var/tmp/ccache \
48+
--atom app-editors/nano
49+
50+
- name: Test whether any container is still running
51+
run: docker ps --all
52+
53+
- name: Archive test results
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: ebuildtester log
57+
path: |
58+
/tmp/ebuildtester*.log
59+
/var/tmp/ccache/

ebuildtester/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def main():
4848
container.execute("etc-update --verbose --automode -5")
4949
else:
5050
break
51-
options.log.info("opening interactive shell")
52-
container.shell()
51+
if not options.options.batch:
52+
options.log.info("opening interactive shell")
53+
container.shell()
5354

5455
container.cleanup()

ebuildtester/parse.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ def parse_commandline(args):
134134
"--ccache",
135135
metavar="CCACHE_DIR",
136136
help="Path to mount that contains ccache cache")
137+
parser.add_argument(
138+
'--batch',
139+
help='Do not drop into interactive shell',
140+
action='store_true')
137141

138142
if '--complete' in args:
139143
print('Suggesting')

0 commit comments

Comments
 (0)