forked from git-ai-project/git-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
175 lines (152 loc) · 5.03 KB
/
Copy pathTaskfile.yml
File metadata and controls
175 lines (152 loc) · 5.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
version: "3"
vars:
TEST_FILTER: '{{default "" .TEST_FILTER}}'
CARGO_TEST_ARGS: '{{default "" .CARGO_TEST_ARGS}}'
EXTRA_TEST_BINARY_ARGS: '{{default "" .EXTRA_TEST_BINARY_ARGS}}'
NO_CAPTURE: '{{default "false" .NO_CAPTURE}}'
TEST_BINARY_ARGS:
sh: |
args=""
if [ "{{.NO_CAPTURE}}" = "true" ]; then
args="--nocapture"
fi
if [ -n "{{.EXTRA_TEST_BINARY_ARGS}}" ]; then
args="$args {{.EXTRA_TEST_BINARY_ARGS}}"
fi
printf '%s' "$args"
TEST_THREADS:
sh: |
if [ -n "$NUMBER_OF_PROCESSORS" ]; then
n=$(powershell -NoProfile -NonInteractive -Command "[Environment]::ProcessorCount")
elif command -v nproc >/dev/null 2>&1; then
n=$(nproc)
elif command -v getconf >/dev/null 2>&1; then
n=$(getconf _NPROCESSORS_ONLN)
else
n=$(sysctl -n hw.ncpu)
fi
[ "$n" -gt 12 ] && echo 12 || echo "$n"
tasks:
dev:
desc: |
Install a git-ai debug build for local dev on the system so that all git commands will route through it.
Installs to the same location as real release builds, so it overrides system-wide. It also runs `git-ai install`
and restarts the daemon to ensure all latest code changes are fully installed and propagated system-wide.
Use this for trying out changes locally -- do not use any other approaches for runing git-ai locally. They will
not work, interfere, and break things.
cmds:
- cmd: powershell -NonInteractive -NoProfile -ExecutionPolicy Bypass -File scripts/dev.ps1
platforms: [windows]
- cmd: ./scripts/dev.sh
platforms: [linux, darwin]
clean:
desc: Clean build artifacts
cmds:
- cargo clean
build:
desc: Build the project (only use this for checking that the project builds, not for running locally -- use `task dev` instead)
cmds:
- cargo build
test:base:
internal: true
cmds:
- cargo test {{.CARGO_TEST_ARGS}} {{.TEST_FILTER}} -- --test-threads {{.TEST_THREADS}} {{.TEST_BINARY_ARGS}} {{.SUBTASK_BINARY_ARGS}}
env:
GIT_AI_TEST_SHARED_DAEMON_POOL_SIZE: "{{.TEST_THREADS}}"
test:
desc: Run tests
cmds:
- task: test:base
test:fuzz:
desc: Run the attribution fuzzer (fixed seeds only)
cmds:
- task: test:base
vars:
TEST_FILTER: fuzz_standard_seed_
test:fuzz:all:
desc: Run all fuzzer tests including random seed and heavy variants
cmds:
- task: test:base
vars:
TEST_FILTER: fuzz_
test:fuzz:heavy:
desc: Run all fuzzer tests with verbose output
cmds:
- task: test:base
vars:
TEST_FILTER: fuzz_
SUBTASK_BINARY_ARGS: "--nocapture"
test:fuzz:partial:
desc: Run partial staging fuzzer tests
cmds:
- task: test:base
vars:
TEST_FILTER: fuzz_partial_stage_
test:fuzz:destructive:
desc: Run destructive ops fuzzer tests (resets, stash, checkouts)
cmds:
- task: test:base
vars:
TEST_FILTER: fuzz_destructive_
test:fuzz:squash:
desc: Run squash-heavy fuzzer tests (targets attribution holes post-squash)
cmds:
- task: test:base
vars:
TEST_FILTER: fuzz_squash_
test:fuzz:combined:
desc: Run combined ops fuzzer tests (cherry-pick, branch merge, squash combos)
cmds:
- task: test:base
vars:
TEST_FILTER: fuzz_combined_
test:fuzz:workflow:
desc: Run workflow fuzzer tests (plumbing, fixup, cherry-pick ranges, rebase --onto)
cmds:
- task: test:base
vars:
TEST_FILTER: fuzz_workflow_
test:fuzz:marathon:
desc: Run marathon fuzzer tests (150-200 ops, very long running)
cmds:
- task: test:base
vars:
TEST_FILTER: fuzz_marathon_
SUBTASK_BINARY_ARGS: "--ignored"
lint:
desc: Run cargo check and clippy with warnings as errors
cmds:
- cargo clippy --all-targets -- -D warnings
doc:
desc: Build documentation with warnings as errors
cmds:
- cargo doc --no-deps
env:
RUSTDOCFLAGS: "-D warnings"
format:
desc: Format code with rustfmt
aliases: [fmt]
cmds:
- cargo fmt
format:check:
desc: Check code formatting (CI)
cmds:
- cargo fmt -- --check
coverage:
desc: Run tests with coverage and show summary
cmds:
- cargo llvm-cov test --ignore-filename-regex='tests/.*|benches/.*|examples/.*'
coverage:html:
desc: Generate HTML coverage report and open in browser
cmds:
- cargo llvm-cov test --ignore-filename-regex='tests/.*|benches/.*|examples/.*' --html --open
coverage:lcov:
desc: Generate LCOV coverage report
cmds:
- cargo llvm-cov test --ignore-filename-regex='tests/.*|benches/.*|examples/.*' --lcov --output-path lcov.info
coverage:check:
desc: Run coverage and fail if below threshold
cmds:
- cargo llvm-cov test --ignore-filename-regex='tests/.*|benches/.*|examples/.*' --fail-under-lines {{.COVERAGE_THRESHOLD}}
vars:
COVERAGE_THRESHOLD: '{{.COVERAGE_THRESHOLD | default "50"}}'