<commit_before>package goauto

import (
	"log"
	"os"
	"path/filepath"
	"strconv"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
)

func TestPipeline(t *testing.T) {
	p := NewPipeline("Pipline Name", Silent)
	assert.NotNil(t, p)
}

func TestPipelineRec(t *testing.T) {
	p := NewPipeline("Test Pipeline", Silent)
	tp := filepath.Join("src", "github.com", "dshills", "goauto")
	err := p.WatchRecursive(tp, IgnoreHidden)
	assert.Nil(t, err)
}

func TestPipelineWorkflow(t *testing.T) {
	wf := Workflow{}
	p := NewPipeline("Test Pipeline", Verbose)
	p.Add(&wf)

	wf2 := NewWorkflow(NewGoVetTask(), NewGoLintTask())
	p.Add(wf2)
}

func TestPipelineConcurrency(t *testing.T) {
	t0 := time.Now()
	p := NewPipeline("Test Pipeline", Silent)
	tp := filepath.Join("src", "github.com", "dshills", "goauto", "testing")
	err := p.WatchRecursive(tp, IgnoreHidden)
	assert.Nil(t, err)

	wf := NewWorkflow(NewGoVetTask(), NewGoLintTask(), NewGoBuildTask())
	p.Add(wf)

	p.Stop()

	go p.Start()

	atp, err := AbsPath(tp)
	assert.Nil(t, err)
	for i := 0; i < 100; i++ {
		n := filepath.Join(atp, strconv.Itoa(i))
		os.Mkdir(n, 0744)
	}

	for i := 0; i < 100; i++ {
		n := filepath.Join(atp, strconv.Itoa(i))
		os.Remove(n)
	}

	p.Stop()<commit_msg>pipeline_test should not use sub package tasks<commit_after>package goauto

import (
	"log"
	"os"
	"path/filepath"
	"strconv"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
)

func TestPipeline(t *testing.T) {
	p := NewPipeline("Pipline Name", Silent)
	assert.NotNil(t, p)
}

func TestPipelineRec(t *testing.T) {
	p := NewPipeline("Test Pipeline", Silent)
	tp := filepath.Join("src", "github.com", "dshills", "goauto")
	err := p.WatchRecursive(tp, IgnoreHidden)
	assert.Nil(t, err)
}

func TestPipelineWorkflow(t *testing.T) {
	wf := Workflow{}
	p := NewPipeline("Test Pipeline", Verbose)
	p.Add(&wf)

	wf2 := NewWorkflow()
	p.Add(wf2)
}

func TestPipelineConcurrency(t *testing.T) {
	t0 := time.Now()
	p := NewPipeline("Test Pipeline", Verbose)
	tp := filepath.Join("src", "github.com", "dshills", "goauto", "testing")
	err := p.WatchRecursive(tp, IgnoreHidden)
	assert.Nil(t, err)

	wf := NewWorkflow()
	p.Add(wf)

	p.Stop()

	go p.Start()

	atp, err := AbsPath(tp)
	assert.Nil(t, err)
	for i := 0; i < 100; i++ {
		n := filepath.Join(atp, strconv.Itoa(i))
		os.Mkdir(n, 0744)
	}

	for i := 0; i < 100; i++ {
		n := filepath.Join(atp, strconv.Itoa(i))
		os.Remove(n)
	}

	p.Stop()
{'fraction_non_alphanumeric': 0.18955592105263158, 'fraction_numerical': 0.012335526315789474, 'mean_word_length': 4.406666666666666, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6766843', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1041, 'n_words': 212}