Skip to content

Commit

Permalink
squash: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
happz committed Sep 2, 2024
1 parent aab583b commit ee9bc62
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/run/max/data/.fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
18 changes: 18 additions & 0 deletions tests/run/max/data/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/plan:
discover:
how: shell
tests:
- name: Test 1
test: echo "1"
- name: Test 2
test: echo "2"
- name: Test 3
test: echo "3"
- name: Test 4
test: echo "4"
- name: Test 5
test: echo "5"
provision:
how: local
execute:
how: tmt
1 change: 1 addition & 0 deletions tests/run/max/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
summary: Verify --max option splits plans into smaller plans
23 changes: 23 additions & 0 deletions tests/run/max/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1

rlJournalStart
rlPhaseStartSetup
rlRun "run=\$(mktemp -d)" 0 "Create run directory"
rlRun "pushd data"
rlPhaseEnd

rlPhaseStartTest
rlRun -s "tmt run -vv --id $run --max 3"
rlAssertGrep "Splitting plan to batches of 3 tests." $rlRun_LOG
rlAssertGrep "3 tests selected" $rlRun_LOG
rlAssertGrep "summary: 3 tests passed" $rlRun_LOG
rlAssertGrep "2 tests selected" $rlRun_LOG
rlAssertGrep "summary: 2 tests passed" $rlRun_LOG
rlPhaseEnd

rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $run" 0 "Remove run directory"
rlPhaseEnd
rlJournalEnd

0 comments on commit ee9bc62

Please sign in to comment.