Skip to content

Commit

Permalink
ON-15255: Reduce Jenkins system tests to a smaller subset of unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krishd-amd committed Apr 19, 2024
1 parent 45a1c9f commit fef3a44
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 32 deletions.
26 changes: 1 addition & 25 deletions ci/test.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ nm.slack_notify() {
scmmanager.cloneGit(optionsMap, version_info['products']['Onload']['repo_source'])
}
stash(name: 'onload-src', includes: 'onload/**', useDefaultExcludes: true)

dir('packetdrill-tcpdirect') {
Map optionsMap = ['branch':version_info['products']['Packetdrill']['version']]
scmmanager.cloneGit(optionsMap, version_info['products']['Packetdrill']['repo_source'])
}
stash(name: 'packetdrill-tcpdirect-src', includes: 'packetdrill-tcpdirect/**', useDefaultExcludes: true)
}
}

Expand Down Expand Up @@ -159,7 +153,6 @@ nm.slack_notify() {
sh 'rm -fr tcpdirect onload packetdrill-tcpdirect test-results'
unstash('tcpdirect-src')
unstash('onload-src')
unstash('packetdrill-tcpdirect-src')
sh 'ls -lad $PWD'
def CC = sh(script: 'ls -1d /opt/rh/devtoolset-{11,10,9,8}/root/usr/bin/cc $(which cc) 2>/dev/null | head -1',
returnStdout: true)
Expand All @@ -171,30 +164,13 @@ nm.slack_notify() {
export ONLOAD_TREE=\$PWD/onload
export ZF_DEVEL=1
export TEST_THREAD_NAME=zf
export TEST_RESULTS=\$PWD/test-results
# export GCOV=1
export UT_OUTPUT=\$PWD/test-results
make -k -C tcpdirect test
make -k -C tcpdirect test_jenkins
"""
stash(
name: "junit-zf",
includes: 'test-results/**',
)
}
},
)
}

node('master') {
// this does not need any specific node
stage('Generate test report') {
sh 'rm -fr test-results'
unstash("junit-zf")
junit('test-results/**')
currentBuild.description = tm.getTestResultString()
}
}

// This step produces release artifacts, must be run in controlled environment
node('unit-test-master') {
stage("Build TCPDirect Tarball") {
Expand Down
22 changes: 15 additions & 7 deletions src/tests/zf_unit/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
# allowing to run subsets of tests with various variants
UT_LOOP := zftest zfinit zfudprx zf_superbuf_reuse zftcprx zftcpcopyrx \
zftcptx zfmulticast zftcp_muxer \
zfds efrxtimestamping zftimestamping zftcprx_on14495
zfds efrxtimestamping zftcprx_on14495
UT_LOOP2 := zftest zfinit zfudprx zf_superbuf_reuse zftcprx zftcpcopyrx \
zftcptx zfmulticast zftcp_muxer \
zfds efrxtimestamping zftcprx_on14495
UT_JENKINS := zfstackdump zftimestamping
UT_MISC := zfpool zfmuxer zfrxtable zfzockbuf \
zfmultizock zftimers zflisten zfbackingsock zfzockfree \
zfquiesce_waittw zfquiesce_nowaittw zfstackfree \
zfshm zfattrs zfattr_getset \
zfpending zftcp_full_sendq zfstackdump \
zfpending zftcp_full_sendq \
zfbonding zfbonding_lacp zfmultizock_bond # these bonding tests should go to UT_LOOP but fail with vlan
UT_DELEGATED := zfdelegated
UT_B2B := zftcptimeouts zfovl zfreactorloop zfonlystack
Expand All @@ -27,6 +28,7 @@ UT_ALTS := zfalternatives
UT_OTHER := zftcppingpong2
UT_SCRIPTS := zfudppingpong.sh zf_tcp_sanity.sh packetdrill.sh zfsend.sh zfudpttl.sh


# sort is required to remove duplicates
UT_ALL := $(sort \
$(UT_LOOP) \
Expand All @@ -36,7 +38,8 @@ UT_ALL := $(sort \
$(UT_B2B) \
$(UT_B2B_SB) \
$(UT_ALTS) \
$(UT_OTHER))
$(UT_OTHER) \
$(UT_JENKINS))


UT_OBJS := $(UT_ALL:%=$(OBJ_CURRENT)/%.o)
Expand Down Expand Up @@ -106,7 +109,7 @@ target_variants_ = $(1) $(foreach v, $(variants), $(1)_$v)
target_variants = $(foreach t,$(1),$(call target_variants_,$(t)))
target_explode = $(call target_variants,$(1)) $(call target_variants,$(2:%=run_%))

UT_NONSCRIPT_LISTS := testloop testloop2 testmisc testdelegated testb2b testb2bsb testalts testrxx3
UT_NONSCRIPT_LISTS := testloop testloop2 testjenkins testmisc testdelegated testb2b testb2bsb testalts testrxx3
UT_SCRIPT_LISTS := testscript testpacketdrill
UT_ALL_LISTS = $(UT_NONSCRIPT_LISTS) $(UT_SCRIPT_LISTS)

Expand All @@ -122,6 +125,7 @@ UT_ALL_NONSCRIPT_TARGETS := $(UT_ALL_LOOP_TARGETS) $(UT_ALL_MISC_TARGETS) \
$(UT_ALL_B2B_SB_TARGETS)
UT_ALL_SCRIPT_TARGETS := $(call target_explode,testscript,$(UT_SCRIPTS)) \
$(call target_variants,testpacketdrill,$(UT_SCRIPTS))
UT_ALL_JENKINS_TARGETS := $(call target_explode,testjenkins,$(UT_JENKINS))
UT_ALL_TARGETS := $(UT_ALL_NONSCRIPT_TARGETS) \
$(UT_ALL_SCRIPT_TARGETS)

Expand Down Expand Up @@ -196,13 +200,15 @@ endif

$(call target_variants,testloop): $(UT_LOOP:%=$(UT_BINDIR)/%)
$(call target_variants,testloop2): $(UT_LOOP2:%=$(UT_BINDIR)/%)
$(call target_variants,testjenkins): $(UT_JENKINS:%=$(UT_BINDIR)/%)
$(call target_variants,testmisc): $(UT_MISC:%=$(UT_BINDIR)/%)
$(call target_variants,testdelegated): $(UT_DELEGATED:%=$(UT_BINDIR)/%)
$(call target_variants,testb2bsb): $(UT_B2B_SB:%=$(UT_BINDIR)/%)
$(call target_variants,testb2b): $(UT_B2B:%=$(UT_BINDIR)/%)
$(call target_variants,testalts): $(UT_ALTS:%=$(UT_BINDIR)/%)
$(call target_variants,testscript): $(filter-out %packetdrill.sh,$(UT_SCRIPT_BINS))
$(call target_variants,testpacketdrill): $(filter %packetdrill.sh,$(UT_SCRIPT_BINS))

# for phony targets it does not matter whether dependencies are order-only or not
# However order-only dependencies are out of $^ which makes recipes simpler.
ifeq ("$(wildcard ../packetdrill-tcpdirect)", "")
Expand Down Expand Up @@ -252,9 +258,11 @@ test: testloop \
testloop_vlan testloop_txvi testmisc \
testb2bsb \
testdelegated_smallmtu \
testb2b testalts testalts_vlan testalts_txvi testpacketdrill \
testscript_x3\
testscript
testb2b testalts testalts_vlan testalts_txvi testpacketdrill

test_jenkins: testjenkins \
testscript_x3 \
testscript


.PHONY: zf_unit test
Expand Down

0 comments on commit fef3a44

Please sign in to comment.