diff --git a/integration_tests/run.sh b/integration_tests/run.sh index 0c071d153..7303cf42a 100755 --- a/integration_tests/run.sh +++ b/integration_tests/run.sh @@ -6,12 +6,18 @@ cd ../v2/cmd/nuclei go build mv nuclei ../../../integration_tests/nuclei echo "::endgroup::" + echo "::group::Build nuclei integration-test" cd ../integration-test go build mv integration-test ../../../integration_tests/integration-test cd ../../../integration_tests echo "::endgroup::" + +echo "::group::Installing nuclei templates" +./nuclei -update-templates +echo "::endgroup::" + ./integration-test if [ $? -eq 0 ] then diff --git a/v2/cmd/functional-test/run.sh b/v2/cmd/functional-test/run.sh index f53978219..4c72641fe 100755 --- a/v2/cmd/functional-test/run.sh +++ b/v2/cmd/functional-test/run.sh @@ -15,6 +15,10 @@ echo "::group::Building Nuclei binary from current branch" go build -o nuclei_dev$extension ../nuclei echo "::endgroup::" +echo "::group::Installing nuclei templates" +./nuclei$extension -update-templates +echo "::endgroup::" + echo "::group::Building latest release of nuclei" go build -o nuclei$extension -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei echo "::endgroup::" diff --git a/v2/pkg/testutils/integration.go b/v2/pkg/testutils/integration.go index a681c286c..455ce6d1b 100644 --- a/v2/pkg/testutils/integration.go +++ b/v2/pkg/testutils/integration.go @@ -45,6 +45,7 @@ func RunNucleiAndGetResults(isTemplate bool, template, url string, debug bool, e func RunNucleiBareArgsAndGetResults(debug bool, extra ...string) ([]string, error) { cmd := exec.Command("./nuclei") cmd.Args = append(cmd.Args, extra...) + cmd.Args = append(cmd.Args, "-duc") // disable auto updates if debug { cmd.Args = append(cmd.Args, "-debug") cmd.Stderr = os.Stderr @@ -74,6 +75,7 @@ var templateLoaded = regexp.MustCompile(`(?:Templates|Workflows) loaded[^:]*: (\ // RunNucleiBinaryAndGetLoadedTemplates returns a list of results for a template func RunNucleiBinaryAndGetLoadedTemplates(nucleiBinary string, debug bool, args []string) (string, error) { cmd := exec.Command(nucleiBinary, args...) + cmd.Args = append(cmd.Args, "-duc") // disable auto updates if debug { cmd.Args = append(cmd.Args, "-debug") fmt.Println(cmd.String())