File tree Expand file tree Collapse file tree 6 files changed +85
-1
lines changed Expand file tree Collapse file tree 6 files changed +85
-1
lines changed Original file line number Diff line number Diff line change 48
48
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49
49
50
50
- run : just ${{ matrix.just_goals || 'build test' }}
51
+ env :
52
+ GPTCOMMIT__OPENAI__API_KEY : ${{ secrets.GPTCOMMIT__OPENAI__API_KEY }}
51
53
52
54
lint :
53
55
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ release:
21
21
install :
22
22
cargo install --path .
23
23
24
- test * args :
24
+ e2e : install
25
+ sh -eux -c ' for i in ./e2e/test_*.sh ; do sh -x $i ; done'
26
+
27
+ test * args : e2e
25
28
cargo test
26
29
alias t := test
27
30
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -eu
3
+
4
+ gptcommit config list
5
+ # assert is valid TOML
6
+
7
+ gptcommit config get openai.model
8
+ # assert default = text-davinci-003
9
+ gptcommit config set openai.model foo
10
+ gptcommit config get openai.model
11
+ # assert is foo
12
+
13
+ gptcommit config delete openai.model
14
+ gptcommit config get openai.model
15
+ # back to default
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -eu
3
+
4
+ (
5
+ mkdir test_dir_foo4
6
+ cd test_dir_foo4
7
+ git init
8
+
9
+ export TEMPFILE=$( mktemp)
10
+ echo " foo" > $TEMPFILE
11
+
12
+ GPTCOMMIT__OPENAI__MODEL=" text-ada-001" \
13
+ gptcommit prepare-commit-msg \
14
+ --git-diff-content ../tests/data/example_1.diff \
15
+ --commit-msg-file $TEMPFILE \
16
+ --commit-source " "
17
+
18
+ cat $TEMPFILE
19
+ )
20
+ rm -rf test_dir_foo4
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -eu
3
+
4
+ (
5
+ mkdir test_dir_foo
6
+ cd test_dir_foo
7
+ git init
8
+ gptcommit install
9
+
10
+ # assert that git hook is installed
11
+ gptcommit install
12
+ # assert still works
13
+ )
14
+ rm -rf test_dir_foo ;
15
+
16
+ # ############################
17
+
18
+ (
19
+ mkdir test_dir_foo2
20
+ cd test_dir_foo2
21
+ git init
22
+ mkdir a
23
+ cd a
24
+ gptcommit install
25
+ )
26
+ rm -rf test_dir_foo2
27
+
28
+ # ############################
29
+
30
+ (
31
+ mkdir test_dir_foo3
32
+ cd test_dir_foo3
33
+ # no git init
34
+ gptcommit install ;
35
+ )
36
+ rm -rf test_dir_foo3
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -eu
3
+
4
+ gptcommit --version
5
+ # assert matches version in Cargo.toml
6
+
7
+ gptcommit --help
8
+
You can’t perform that action at this time.
0 commit comments