Skip to content

Commit

Permalink
Pull request quattor#110: AQUILONAQD-955: JENKINS-PIPELINE-MIGRATION
Browse files Browse the repository at this point in the history
Merge in AQUILON_AQD/aqd from ~KAMURTHY/aquilon.aqd:Feature/AQUILONAQD-955/Jenkins-Pipeline-Migration to master

* commit '784f82e7306d54ce1e1d41d1bf044ca074464fe8':
  * AQUILONAQD-955: JENKINS-PIPELINE-MIGRATION
  AQUILONAQD-955: JENKINS-PIPELINE-MIGRATION
  • Loading branch information
joaocosta committed Sep 7, 2021
2 parents b68a8c3 + 784f82e commit fc81656
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
1 change: 0 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ version.txt: FORCE
clean:
-rm -rf html
-rm -rf man
-rm -f version.txt
-rm -f $(GENERATED_XML)

install-man: man
Expand Down
7 changes: 5 additions & 2 deletions tests/jenkinstest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o pipefail
TESTDIR="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
BASEDIR="$(dirname "$(dirname "$TESTDIR")")"

mkdir -p $BASEDIR/run
mkdir -p /var/tmp/$USER/run

# Look for a couple of free ports to use
while true; do
Expand All @@ -29,14 +30,16 @@ while true; do
fi
done


# Massage unittest.conf
sed -e "s!^basedir =.*\$!basedir = $BASEDIR/run!" \
sed -e "s!^basedir =.*\$!basedir = /var/tmp/$USER/run!" \
-e "s/^kncport =.*$/kncport = ${KNCPORT}/" \
-e "s/^openport =.*$/openport = ${OPENPORT}/" \
-e "s/^git_port =.*$/git_port = ${GITPORT}/" \
$TESTDIR/unittest.conf > \
$BASEDIR/unittest.conf


# Make sure UNITTEST_FAILURE is returned if tests fail otherwise jenkins does not mark build as failed
$TESTDIR/runtests.py --config $BASEDIR/unittest.conf --coverage 2>&1 --no-interactive | tee $TESTDIR/aqdtests.log
if [ $(grep -c '^OK$' $TESTDIR/aqdtests.log 2>/dev/null) -ne 2 ]; then
Expand Down
30 changes: 21 additions & 9 deletions train.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,40 @@ train_version: 1.0

tools:
- msde/git/2.9.5
- python/core/2.7.9-64
- python/core/2.7.18-64
- msde/msdlbuild/prod


build_types:
- build_type:
name: release
build:
- script: msdlbuild clean
- script: make clean
- script: make install
- script: msdlbuild metadata
name: release
build:
- script: git ls-remote --sort='version:refname' --tags /ms/dev/aquilon/aqd/SCM/aqd.git | grep refs/tags/TRAIN_DIST_aquilon/aqd | tail -n 2 | head -n 1 | awk '{print $2}' | sed 's/^\([^/]\+\/\)\{2\}//' > doc/version.txt
- script: msdlbuild clean
- script: make clean
- script: make install
- script: msdlbuild metadata

test_types:
- test_type:
name: all
test: set -o pipefail; ./tests/runtests.py --config=./tests/unittest.conf --no-interactive | tee ./tests/aqdtests.log
- test_type:
name: failfast
test: set -o pipefail; ./tests/runtests.py --config=./tests/unittest.conf --failfast --no-interactive | tee ./tests/aqdtests.log
test: set -o pipefail; ./tests/runtests.py --config=./tests/unittest.conf --failfast --no-interactive --coverage | tee ./tests/aqdtests.log
- test_type:
name: restart
test: ./tests/restarttests.sh
- test_type:
name: jenkins
test: ./tests/jenkinstest.sh
test:
- script: |
./tests/jenkinstest.sh
mkdir -p ../install/test-results/
cp tests/aqdtests.log ../install/test-results/aqdtests.log
cp -R /var/tmp/$USER/run/quattor/logs/ ../install/test-results/quattor-logs
PYLINTHOME=../run/.pylint.d tests/pylint --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' lib/aquilon/ bin/*.py sbin/*.py > ../install/test-results/pylint.out || /bin/true
# In the past, commits did not have the codestyle.py file available; let's use the flake8 checker directly
module unload python/core/2.7.18-64
module load python/core/3.4.4
./tests/codestyle.py --all > ../install/test-results/flake8.out || /bin/true

0 comments on commit fc81656

Please sign in to comment.