Rework of js-d3-flame-graph gating test to use rpm-build
This commit is contained in:
parent
985c71854f
commit
4fc0819d32
@ -54,6 +54,7 @@ $(METADATA): Makefile
|
|||||||
@echo "TestTime: 15m" >> $(METADATA)
|
@echo "TestTime: 15m" >> $(METADATA)
|
||||||
@echo "RunFor: js-d3-flame-graph" >> $(METADATA)
|
@echo "RunFor: js-d3-flame-graph" >> $(METADATA)
|
||||||
@echo "Requires: js-d3-flame-graph nodejs" >> $(METADATA)
|
@echo "Requires: js-d3-flame-graph nodejs" >> $(METADATA)
|
||||||
|
@echo "Requires: make rpm-build" >> $(METADATA)
|
||||||
@echo "Priority: Normal" >> $(METADATA)
|
@echo "Priority: Normal" >> $(METADATA)
|
||||||
@echo "License: GPLv2+" >> $(METADATA)
|
@echo "License: GPLv2+" >> $(METADATA)
|
||||||
@echo "Confidential: no" >> $(METADATA)
|
@echo "Confidential: no" >> $(METADATA)
|
||||||
|
@ -9,6 +9,8 @@ framework: beakerlib
|
|||||||
recommend:
|
recommend:
|
||||||
- js-d3-flame-graph
|
- js-d3-flame-graph
|
||||||
- nodejs
|
- nodejs
|
||||||
|
- make
|
||||||
|
- rpm-build
|
||||||
duration: 15m
|
duration: 15m
|
||||||
extra-summary: /tools/js-d3-flame-graph/Sanity/upstream-testsuite
|
extra-summary: /tools/js-d3-flame-graph/Sanity/upstream-testsuite
|
||||||
extra-task: /tools/js-d3-flame-graph/Sanity/upstream-testsuite
|
extra-task: /tools/js-d3-flame-graph/Sanity/upstream-testsuite
|
||||||
|
@ -38,26 +38,29 @@ rlJournalStart
|
|||||||
rlRun "rm -rf /root/.npm"
|
rlRun "rm -rf /root/.npm"
|
||||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||||
rlRun "pushd ${TmpDir}"
|
rlRun "pushd ${TmpDir}"
|
||||||
RPM="$(rpm -q --qf '%{name}-%{version}-%{release}' ${PACKAGE})"
|
|
||||||
VERSION="$(rpm -q --qf '%{version}' ${PACKAGE})"
|
|
||||||
rlRpmDownload --source "${RPM}"
|
|
||||||
rlAssertExists "${RPM}.src.rpm" ||\
|
|
||||||
rlDie "Can not recover from the previous error"
|
|
||||||
rlRun "rpm -i --root ${TmpDir} ${RPM}.src.rpm"
|
|
||||||
rlRun "pushd root/rpmbuild/SOURCES/"
|
|
||||||
rlLog "ls -l"
|
|
||||||
rlRun "tar zxf d3-flame-graph-${VERSION}.tar.gz"
|
|
||||||
rlRun "pushd d3-flame-graph-${VERSION}"
|
|
||||||
rlRun "tar Jxf ../d3-flame-graph-deps-${VERSION}.tar.xz"
|
|
||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
|
||||||
rlPhaseStartTest
|
rlPhaseStartTest "Prepare ${PACKAGE} for testing"
|
||||||
|
rlFetchSrcForInstalled "${PACKAGE}" \
|
||||||
|
|| rlDie "Can not download SRPM of ${PACKAGE} - giving up"
|
||||||
|
rlRun "rpm -D \"_topdir ${TmpDir}\" -U \
|
||||||
|
$(rpm -q --qf '%{name}-%{version}-%{release}.src.rpm' ${PACKAGE}.noarch)"
|
||||||
|
rlRun "rpmbuild --nodeps -D \"_topdir ${TmpDir}\" \
|
||||||
|
-bp ${TmpDir}/SPECS/${PACKAGE}.spec"
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "Run the upstream testsuite"
|
||||||
|
BDIR=$(rpm -q --qf '%{name}-%{version}' ${PACKAGE}.noarch)
|
||||||
|
P=$(sed 's/^js-//' <<< "${BDIR}")
|
||||||
|
if rlRun "pushd ${TmpDir}/BUILD/${P}/test"; then
|
||||||
rlRun "npm run test"
|
rlRun "npm run test"
|
||||||
|
rlRun "popd"
|
||||||
|
else
|
||||||
|
rlFail "Can not find the working directory of the upstream testsuite"
|
||||||
|
fi
|
||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
|
||||||
rlPhaseStartCleanup
|
rlPhaseStartCleanup
|
||||||
rlRun "popd"
|
|
||||||
rlRun "popd"
|
|
||||||
rlRun "popd"
|
rlRun "popd"
|
||||||
rlRun "rm -rf ${TmpDir}" 0 "Removing tmp directory"
|
rlRun "rm -rf ${TmpDir}" 0 "Removing tmp directory"
|
||||||
rlRun "rm -rf /root/.npm"
|
rlRun "rm -rf /root/.npm"
|
||||||
|
Loading…
Reference in New Issue
Block a user