Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import spock.lang.Specification

class EarlyFlakeDetectionSettingsSerializerTest extends Specification {

def "test serialization: #settings"() {
def "test serialization: #iterationIndex"() {
when:
Serializer s = new Serializer()
EarlyFlakeDetectionSettingsSerializer.serialize(s, settings)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class LocalFSGitInfoExtractorTest extends DDSpecification {
)
}

def "test git info extraction for local fs"() {
def "test git info extraction for local fs #gitFolder"() {
setup:
def sut = new LocalFSGitInfoExtractor()

Expand Down Expand Up @@ -119,7 +119,7 @@ class LocalFSGitInfoExtractorTest extends DDSpecification {
fullMessage == null
}

def "test repository url with different remotes"() {
def "test repository url with different remotes #gitFolder"() {
setup:
def sut = new LocalFSGitInfoExtractor()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ class SerializerTest extends Specification {
this.b = b
}

@Override
String toString() {
"$a / $b"
}

boolean equals(o) {
if (this.is(o)) {
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ class PropagationModuleTest extends IastModuleImplTestBase {
}

private Date date(Source source = null, int mark = NOT_MARKED) {
final result = new Date()
final result = new Date(1234567890) // Use a fixed date
if (source != null) {
taintObject(result, source, mark)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datadog.trace.agent.test.AgentTestRunner
import datadog.trace.agent.test.server.http.TestHttpServer
import datadog.trace.api.iast.InstrumentationBridge
import datadog.trace.api.iast.sink.SsrfModule
import org.apache.http.HttpHost
Expand Down Expand Up @@ -31,7 +32,7 @@ class IastHttpClientInstrumentationTest extends AgentTestRunner {
}
}

void 'test ssrf httpClient execute method with args #args expecting call module'() {
void 'test ssrf httpClient execute method expecting call module #iterationIndex'() {
given:
final ssrf = Mock(SsrfModule)
InstrumentationBridge.registerIastModule(ssrf)
Expand Down Expand Up @@ -68,7 +69,7 @@ class IastHttpClientInstrumentationTest extends AgentTestRunner {
return new BasicHttpRequest("GET", server.address.toString())
}

private static HttpHost getHttpHost(final server){
private static HttpHost getHttpHost(final TestHttpServer server){
return new HttpHost(server.address.host, server.address.port, server.address.scheme)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class PayloadTaggingExpansionForkedTest extends AbstractPayloadTaggingTest {
injectSysConfig(TracerConfig.TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING, "\$.MessageId,\$.SubscriptionArn,\$[*].phoneNumbers")
}

def "support various types, embedded JSON in string and binary format"() {
def "support various types, embedded JSON in string and binary format #expectedReqTag"() {
setup:
TEST_WRITER.clear()

Expand Down Expand Up @@ -261,7 +261,7 @@ class PayloadTaggingMaxDepthForkedTest extends AbstractPayloadTaggingTest {
injectSysConfig(TracerConfig.TRACE_CLOUD_PAYLOAD_TAGGING_MAX_DEPTH, "4")
}

def "generate tags up to the specified max depth"() {
def "generate tags up to the specified max depth #expectedReqTag"() {
setup:
TEST_WRITER.clear()

Expand Down Expand Up @@ -315,7 +315,7 @@ class PayloadTaggingMaxTagsForkedTest extends AbstractPayloadTaggingTest {
injectSysConfig(TracerConfig.TRACE_CLOUD_PAYLOAD_TAGGING_MAX_TAGS, "5")
}

def "generate tags up to the specified max number"() {
def "generate tags up to the specified max number #iterationIndex"() {
setup:
TEST_WRITER.clear()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Base64CallSiteTest extends AgentTestRunner {
injectSysConfig('dd.iast.enabled', 'true')
}

void 'test encode base 64'() {
void 'test encode base 64 #iterationIndex'() {
given:
final module = Mock(CodecModule)
InstrumentationBridge.registerIastModule(module)
Expand All @@ -33,7 +33,7 @@ class Base64CallSiteTest extends AgentTestRunner {
'encode' | ['Hello'.bytes, new Base64()]
}

void 'test decode base 64'() {
void 'test decode base 64 #iterationIndex'() {
given:
final module = Mock(CodecModule)
InstrumentationBridge.registerIastModule(module)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Json1ParserInstrumentationTest extends AgentTestRunner {
injectSysConfig("dd.iast.enabled", "true")
}

void 'test json parsing (tainted)'() {
void 'test json parsing #iterationIndex (tainted)'() {
given:
final source = new SourceImpl(origin: SourceTypes.REQUEST_BODY, name: 'body', value: JSON_STRING)
final module = Mock(PropagationModule)
Expand Down Expand Up @@ -45,7 +45,7 @@ class Json1ParserInstrumentationTest extends AgentTestRunner {
target << testSuite()
}

void 'test json parsing (not tainted)'() {
void 'test json parsing #iterationIndex (not tainted)'() {
given:
final module = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(module)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
InstrumentationBridge.clearIastModules()
}

void 'test getHeader'() {
void 'test getHeader #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -58,7 +58,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test getHeaders'() {
void 'test getHeaders #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -79,7 +79,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test getHeaderNames'() {
void 'test getHeaderNames #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -100,7 +100,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test getParameter'() {
void 'test getParameter #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -120,7 +120,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test getParameterValues'() {
void 'test getParameterValues #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -141,7 +141,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test getParameterMap'() {
void 'test getParameterMap #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -168,7 +168,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
}


void 'test getParameterNames'() {
void 'test getParameterNames #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -189,7 +189,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test getCookies'() {
void 'test getCookies #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -210,7 +210,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test that get headers does not fail when servlet related code fails'() {
void 'test that get headers does not fail when servlet related code fails #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand Down Expand Up @@ -238,7 +238,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test that get header names does not fail when servlet related code fails'() {
void 'test that get header names does not fail when servlet related code fails #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand Down Expand Up @@ -266,7 +266,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test get query string'() {
void 'test get query string #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -287,7 +287,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test getInputStream'() {
void 'test getInputStream #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -308,7 +308,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test getReader'() {
void 'test getReader #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -329,7 +329,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test getRequestDispatcher'() {
void 'test getRequestDispatcher #iterationIndex'() {
setup:
final iastModule = Mock(UnvalidatedRedirectModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -351,7 +351,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuite()
}

void 'test getRequestURI'() {
void 'test getRequestURI #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -372,7 +372,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuiteCallSites()
}

void 'test getPathInfo'() {
void 'test getPathInfo #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -393,7 +393,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuiteCallSites()
}

void 'test getPathTranslated'() {
void 'test getPathTranslated #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -414,7 +414,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuiteCallSites()
}

void 'test getRequestURL'() {
void 'test getRequestURL #iterationIndex'() {
setup:
final iastModule = Mock(PropagationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand All @@ -435,7 +435,7 @@ class JakartaHttpServletRequestInstrumentationTest extends AgentTestRunner {
suite << testSuiteCallSites()
}

void 'test getSession'() {
void 'test getSession #iterationIndex'() {
setup:
final iastModule = Mock(ApplicationModule)
InstrumentationBridge.registerIastModule(iastModule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class AgentTestRunnerTest extends AgentTestRunner {
noExceptionThrown()
}

def "excluded classes are not instrumented"() {
def "excluded classes are not instrumented #iterationIndex"() {
when:
runUnderTrace("parent") {
subject.run()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import static excludefilter.ExcludeFilterTestInstrumentation.RunnableExcludedExe

class ExcludeFilterForkedTest extends AgentTestRunner {

def "test ExcludeFilter"() {
def "test ExcludeFilter #runnable.class.name"() {
expect:
ExcludeFilter.exclude(RUNNABLE, runnable) == excluded

Expand Down
Loading