node js tests
This commit is contained in:
parent
a4ca9df41b
commit
f1ee23f5fa
26 changed files with 935 additions and 2 deletions
7
Integration/expressjs-testsuite/main.fmf
Normal file
7
Integration/expressjs-testsuite/main.fmf
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
summary: Runs internal expressjs tests.
|
||||
description: |
|
||||
Test to verify Express’s compatibility with the Node.js.
|
||||
duration: 5m
|
||||
require:
|
||||
- nodejs
|
||||
- git
|
||||
63
Integration/expressjs-testsuite/runtest.sh
Executable file
63
Integration/expressjs-testsuite/runtest.sh
Executable file
|
|
@ -0,0 +1,63 @@
|
|||
#!/bin/bash
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Description: Basic sanity test for express module.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2020 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program is distributed in the hope that it will be
|
||||
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
# PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
# Packages to be tested
|
||||
PACKAGES=${PACKAGES:-nodejs nodejs-npm}
|
||||
# Other required packages
|
||||
REQUIRES=${REQUIRES:-git}
|
||||
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm --all
|
||||
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
|
||||
rlRun "pushd $TmpDir"
|
||||
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "Testsuite"
|
||||
rlRun "git clone https://github.com/expressjs/express.git" 0 "Clone the upstream repo with the Express framework"
|
||||
rlRun "pushd express" 0 "Change directory to the express repo directory"
|
||||
|
||||
rlRun "latest_express=$(npm show express version)" 0 "Figuring out what the latest express version is"
|
||||
rlLog "Latest Express version: ${latest_express}"
|
||||
rlRun "git stash" 0 "Stashing eventual changes so they don't prevent checkout"
|
||||
rlRun "git checkout '${latest_express}'" 0 "Checkout git's tag ${latest_express}"
|
||||
rlRun "npm install mocha"
|
||||
rlRun -s "npm test" 0 "Running the test-suite"
|
||||
rlAssertGrep "[0-9]* passing" "$rlRun_LOG" -E
|
||||
rlAssertNotGrep "[0-9]* failing" "$rlRun_LOG" -E
|
||||
rlAssertNotGrep "Test failed" "$rlRun_LOG"
|
||||
rlRun "popd" 0 "Get back to the original directory"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
Loading…
Add table
Add a link
Reference in a new issue