Tracing test code
- 主要言語
- CodeQL
- スター
- 10.1k
- フォーク
- 2.1k
- 平均マージ
- 2日 15時間
- マージ済み PR(30日)
- 141
説明
For some use-cases (probably not security), it would be useful to instrument test code. This involves some correctness properties, and in my case a custom query to check proper use of the GORM database interface (checking the `Error` code after a SQL query).
I tried commands such as:
codeql database create ../ -l go -c "go test ./foo -c -count 1"
However, the tracer log indicates that we do not consider `go test` suitable for tracing.
Renaming all the `_test.go` files and then building them normally runs into problems with the implicit package structure around tests, e.g:
find . -name '*_test.go' | perl -p -e 's#(.*)_test.go#\1#' | xargs -I {} mv {}_test.go {}_tmp.go
rg 'package .*_test' -l | xargs perl -p -i -e 's#package (.*)_test#package \1#'
コントリビューションガイド
評価
この issue はまだ評価されていません。