Onboard package into gating

This commit is contained in:
Mikolaj Izdebski 2023-03-08 08:18:59 +01:00 committed by mkoncek
parent b6321cc1ea
commit eec44c9aa9
9 changed files with 108 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

8
gating.yaml Normal file
View File

@ -0,0 +1,8 @@
--- !Policy
product_versions:
- fedora-*
decision_contexts:
- bodhi_update_push_testing
- bodhi_update_push_stable
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

5
plans/plan.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Run tests from dist-git
discover:
how: fmf
execute:
how: tmt

5
tests/macros/main.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Jurand macros test
description: |
Test whether Jurand RPM macros work.
require:
- rpm-build

41
tests/macros/runtest.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
# Author: Mikolaj Izdebski <mizdebsk@redhat.com>
. /usr/share/beakerlib/beakerlib.sh
rlJournalStart
rlPhaseStartSetup
rlAssertRpm jurand
rlAssertRpm rpm-build
rlPhaseEnd
rlPhaseStartTest
rlAssertGrep "^import com.Foo;$" test_template.java
rlAssertGrep "^import biz.Bar;$" test_template.java
rlAssertGrep "^@Foo$" test_template.java
rlAssertGrep "^class test{}$" test_template.java
rlRun "cp test_template.java test.java"
rlRun -s "rpm -E '%java_remove_imports test.java -n Foo'"
rlAssertGrep /usr/bin/jurand $rlRun_LOG
rlRun "sh $rlRun_LOG"
rlAssertNotGrep "^import com.Foo;$" test.java
rlAssertGrep "^import biz.Bar;$" test.java
rlAssertGrep "^@Foo$" test.java
rlAssertGrep "^class test{}$" test.java
rlRun "cp test_template.java test.java"
rlRun -s "rpm -E '%java_remove_annotations test.java -n Foo'"
rlAssertGrep /usr/bin/jurand $rlRun_LOG
rlRun "sh $rlRun_LOG"
rlAssertNotGrep "^import com.Foo;$" test.java
rlAssertGrep "^import biz.Bar;$" test.java
rlAssertNotGrep "^@Foo$" test.java
rlAssertGrep "^class test{}$" test.java
rlPhaseEnd
rlPhaseStartCleanup
rlRun "rm -f test.java"
rlPhaseEnd
rlJournalEnd
rlJournalPrintText

View File

@ -0,0 +1,4 @@
import com.Foo;
import biz.Bar;
@Foo
class test{}

4
tests/main.fmf Normal file
View File

@ -0,0 +1,4 @@
contact: Mikolaj Izdebski <mizdebsk@redhat.com>
framework: beakerlib
test: ./runtest.sh
tier: 0

11
tests/smoke/main.fmf Normal file
View File

@ -0,0 +1,11 @@
summary: Jurand smoke test
description: |
Download Guava sources, run Jurand to remove annotations and then
compile Guava to verify that annotations were removed, producing
valid Java code that can be compiled.
require:
- wget
- tar
- gzip
- findutils
- java-1.8.0-openjdk-devel

29
tests/smoke/runtest.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# Author: Mikolaj Izdebski <mizdebsk@redhat.com>
. /usr/share/beakerlib/beakerlib.sh
rlJournalStart
rlPhaseStartSetup
rlAssertRpm jurand
rlAssertRpm java-1.8.0-openjdk-devel
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
rlRun "wget https://src.fedoraproject.org/lookaside/pkgs/guava/guava-31.1.tar.gz/sha512/660b486d82d526ce722130f2968ea8ab9eb53f5915f80e53ef135a7bfcb6ced9b2f2a50ebdb8b316cc48a4f2553fa067a1d6fc0bc4498774a9f1990a535651b8/guava-31.1.tar.gz"
rlAssertExists guava-31.1.tar.gz
rlRun "tar xf guava-31.1.tar.gz"
rlAssertExists guava-31.1
rlPhaseEnd
rlPhaseStartTest
rlRun "jurand -i -a guava-31.1/guava/src -p org[.]checkerframework[.] com[.]google[.]common[.]annotations[.] com[.]google[.]errorprone[.]annotation[.] com[.]google[.]errorprone[.]annotations[.] com[.]google[.]j2objc[.]annotations[.] javax[.]annotation[.]"
rlRun -s "find guava-31.1/guava/src guava-31.1/futures/failureaccess/src -name \*.java | sort"
rlRun -s "${JAVA_HOME}/bin/javac -d . @$rlRun_LOG"
rlAssertNotGrep error: $rlRun_LOG
rlAssertExists com/google/common/base/Strings.class
rlPhaseEnd
rlPhaseStartCleanup
rlRun "rm -rf guava-31.1.tar.gz guava-31.1/ com/"
rlPhaseEnd
rlJournalEnd
rlJournalPrintText