24 lines
632 B
Go
24 lines
632 B
Go
package processing
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"os"
|
||
|
|
"strings"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Source regressions enforce the job/worker language contract without a database.
|
||
|
|
func TestJobWorkerLanguageSelectionWiring(t *testing.T) {
|
||
|
|
source, err := os.ReadFile("pipeline.go")
|
||
|
|
if err != nil {
|
||
|
|
t.Fatal(err)
|
||
|
|
}
|
||
|
|
body := string(source)
|
||
|
|
for _, fragment := range []string{
|
||
|
|
"processing_language", "jobCache.contentLanguages = []string{processingLanguage}",
|
||
|
|
"jobCache.processingLanguage = processingLanguage", "cache.processingLanguage != language",
|
||
|
|
} {
|
||
|
|
if !strings.Contains(body, fragment) {
|
||
|
|
t.Errorf("missing language worker wiring %q", fragment)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|