Compare commits
No commits in common. "240cc571bda17ff4bea83f51ec8ff2c698ac1962" and "44e3feb5c6a575a6a6c8d467b39d143e526c728a" have entirely different histories.
240cc571bd
...
44e3feb5c6
|
@ -21,7 +21,8 @@ func Run(conf *conf.Conf) error {
|
||||||
os.Setenv("LOG_FILE_PATH", conf.Teapot.LogPath)
|
os.Setenv("LOG_FILE_PATH", conf.Teapot.LogPath)
|
||||||
os.Setenv("_TYPER_STANDARD_TRACEBACK", "1")
|
os.Setenv("_TYPER_STANDARD_TRACEBACK", "1")
|
||||||
envFilePath := "/home/tt/.config/teapot/teapot.env"
|
envFilePath := "/home/tt/.config/teapot/teapot.env"
|
||||||
sha := os.Getenv("GITHUB_SHA")
|
// TODO: pass sha to joint-teapot
|
||||||
|
// sha := os.Getenv("GITHUB_SHA")
|
||||||
actor := os.Getenv("GITHUB_ACTOR")
|
actor := os.Getenv("GITHUB_ACTOR")
|
||||||
repository := os.Getenv("GITHUB_REPOSITORY")
|
repository := os.Getenv("GITHUB_REPOSITORY")
|
||||||
runNumber := os.Getenv("GITHUB_RUN_NUMBER")
|
runNumber := os.Getenv("GITHUB_RUN_NUMBER")
|
||||||
|
@ -54,7 +55,7 @@ func Run(conf *conf.Conf) error {
|
||||||
err := execCommand("joint-teapot", []string{
|
err := execCommand("joint-teapot", []string{
|
||||||
"joj3-scoreboard", envFilePath, conf.Stage.OutputPath, actor,
|
"joj3-scoreboard", envFilePath, conf.Stage.OutputPath, actor,
|
||||||
conf.Teapot.GradingRepoName, repoName, runNumber,
|
conf.Teapot.GradingRepoName, repoName, runNumber,
|
||||||
conf.Teapot.ScoreboardPath, conf.Name, sha,
|
conf.Teapot.ScoreboardPath, conf.Name,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
scoreboardErr = err
|
scoreboardErr = err
|
||||||
|
@ -64,7 +65,7 @@ func Run(conf *conf.Conf) error {
|
||||||
err := execCommand("joint-teapot", []string{
|
err := execCommand("joint-teapot", []string{
|
||||||
"joj3-failed-table", envFilePath, conf.Stage.OutputPath, actor,
|
"joj3-failed-table", envFilePath, conf.Stage.OutputPath, actor,
|
||||||
conf.Teapot.GradingRepoName, repoName, runNumber,
|
conf.Teapot.GradingRepoName, repoName, runNumber,
|
||||||
conf.Teapot.FailedTablePath, conf.Name, sha,
|
conf.Teapot.FailedTablePath, conf.Name,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
failedTableErr = err
|
failedTableErr = err
|
||||||
|
@ -76,7 +77,7 @@ func Run(conf *conf.Conf) error {
|
||||||
if !conf.Teapot.SkipIssue {
|
if !conf.Teapot.SkipIssue {
|
||||||
err := execCommand("joint-teapot", []string{
|
err := execCommand("joint-teapot", []string{
|
||||||
"joj3-create-result-issue", envFilePath, conf.Stage.OutputPath,
|
"joj3-create-result-issue", envFilePath, conf.Stage.OutputPath,
|
||||||
repoName, runNumber, conf.Name, actor, sha,
|
repoName, runNumber, conf.Name,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
issueErr = err
|
issueErr = err
|
||||||
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Level int
|
type Level int
|
||||||
|
@ -69,9 +68,6 @@ func levelFromString(levelString string) Level {
|
||||||
}
|
}
|
||||||
|
|
||||||
func isIgnored(line string) bool {
|
func isIgnored(line string) bool {
|
||||||
if strings.TrimSpace(line) == "" {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
ignoreRegex := regexp.MustCompile("^error:.*$")
|
ignoreRegex := regexp.MustCompile("^error:.*$")
|
||||||
return ignoreRegex.MatchString(line)
|
return ignoreRegex.MatchString(line)
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,11 @@ type ClangTidy struct{}
|
||||||
func Parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
|
func Parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
|
||||||
stdout := executorResult.Files["stdout"]
|
stdout := executorResult.Files["stdout"]
|
||||||
stderr := executorResult.Files["stderr"]
|
stderr := executorResult.Files["stderr"]
|
||||||
|
|
||||||
|
lines := strings.SplitAfter(stdout, "\n")
|
||||||
|
messages := ParseLines(lines, conf)
|
||||||
|
formattedMessages := Format(messages)
|
||||||
|
|
||||||
if executorResult.Status != stage.Status(envexec.StatusAccepted) {
|
if executorResult.Status != stage.Status(envexec.StatusAccepted) {
|
||||||
if !((executorResult.Status == stage.Status(envexec.StatusNonzeroExitStatus)) &&
|
if !((executorResult.Status == stage.Status(envexec.StatusNonzeroExitStatus)) &&
|
||||||
(executorResult.ExitStatus == 1)) {
|
(executorResult.ExitStatus == 1)) {
|
||||||
|
@ -36,9 +41,6 @@ func Parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lines := strings.SplitAfter(stdout, "\n")
|
|
||||||
messages := ParseLines(lines, conf)
|
|
||||||
formattedMessages := Format(messages)
|
|
||||||
score, comment := GetResult(formattedMessages, conf)
|
score, comment := GetResult(formattedMessages, conf)
|
||||||
return stage.ParserResult{
|
return stage.ParserResult{
|
||||||
Score: score,
|
Score: score,
|
||||||
|
|
|
@ -33,9 +33,6 @@ func (*ResultDetail) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
comment += fmt.Sprintf("Exit Status: `%d`\n", result.ExitStatus)
|
comment += fmt.Sprintf("Exit Status: `%d`\n", result.ExitStatus)
|
||||||
}
|
}
|
||||||
if conf.ShowError {
|
if conf.ShowError {
|
||||||
if result.Error == "" {
|
|
||||||
result.Error = "nil"
|
|
||||||
}
|
|
||||||
comment += fmt.Sprintf("Error: `%s`\n", result.Error)
|
comment += fmt.Sprintf("Error: `%s`\n", result.Error)
|
||||||
}
|
}
|
||||||
if conf.ShowTime {
|
if conf.ShowTime {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user