Skip to content

Commit 30e1a98

Browse files
authored
Merge pull request #107 from utPLSQL/feature/add_missing_HTML_coverage_reporter_resources
Add back HTML coverage resources.
2 parents 5697135 + ad1735e commit 30e1a98

5 files changed

Lines changed: 62 additions & 6 deletions

File tree

pom.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919

2020
<sonar.organization>utplsql</sonar.organization>
2121
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
22+
23+
<coverage.html.version>1.0.1</coverage.html.version>
24+
<coverage.html.download.dir>${project.build.directory}/coverage-html-download</coverage.html.download.dir>
2225
</properties>
2326

2427
<licenses>
@@ -117,6 +120,49 @@
117120
</resource>
118121
</resources>
119122
<plugins>
123+
<plugin>
124+
<groupId>com.googlecode.maven-download-plugin</groupId>
125+
<artifactId>download-maven-plugin</artifactId>
126+
<version>1.8.1</version>
127+
<executions>
128+
<execution>
129+
<id>download-coverage-html-assets</id>
130+
<phase>generate-resources</phase>
131+
<goals>
132+
<goal>wget</goal>
133+
</goals>
134+
<configuration>
135+
<url>https://github.com/utPLSQL/utPLSQL-coverage-html/archive/refs/tags/${coverage.html.version}.zip</url>
136+
<outputDirectory>${coverage.html.download.dir}</outputDirectory>
137+
<outputFileName>coverage-html.zip</outputFileName>
138+
<unpack>true</unpack>
139+
</configuration>
140+
</execution>
141+
</executions>
142+
</plugin>
143+
<plugin>
144+
<groupId>org.apache.maven.plugins</groupId>
145+
<artifactId>maven-resources-plugin</artifactId>
146+
<version>3.3.1</version>
147+
<executions>
148+
<execution>
149+
<id>copy-coverage-html-assets</id>
150+
<phase>process-resources</phase>
151+
<goals>
152+
<goal>copy-resources</goal>
153+
</goals>
154+
<configuration>
155+
<outputDirectory>${project.build.outputDirectory}/CoverageHTMLReporter</outputDirectory>
156+
<resources>
157+
<resource>
158+
<directory>${coverage.html.download.dir}/utPLSQL-coverage-html-${coverage.html.version}/assets</directory>
159+
<filtering>false</filtering>
160+
</resource>
161+
</resources>
162+
</configuration>
163+
</execution>
164+
</executions>
165+
</plugin>
120166
<plugin>
121167
<groupId>org.apache.maven.plugins</groupId>
122168
<artifactId>maven-compiler-plugin</artifactId>

scripts/sql/simple/scripts/tests/APP.TEST_PKG_TEST_ME.pkb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,16 @@ CREATE OR REPLACE PACKAGE BODY TEST_PKG_TEST_ME AS
122122
UT.EXPECT(VEXPECTED).TO_(EQUAL(VACTUAL));
123123
END;
124124

125+
126+
PROCEDURE TEST_THAT_FAILS IS
127+
BEGIN
128+
UT.FAIL('Tis test is meant to fail to demonstrate failure');
129+
END;
130+
131+
PROCEDURE TEST_THAT_RAISES_EXCEPTION IS
132+
l_num number;
133+
BEGIN
134+
l_num := 1/0;
135+
END;
125136
END;
126137
/

scripts/sql/simple/scripts/tests/APP.TEST_PKG_TEST_ME.pks

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,10 @@ CREATE OR REPLACE PACKAGE TEST_PKG_TEST_ME AS
8484
-- %tags(cursor)
8585
PROCEDURE TEST_PR_TEST_ME_CURSOR;
8686

87+
-- %test( This is a failing test)
88+
PROCEDURE TEST_THAT_FAILS;
89+
90+
-- %test( This is a test that raises an exception)
91+
PROCEDURE TEST_THAT_RAISES_EXCEPTION;
8792
END;
8893
/

src/test/java/org/utplsql/api/TestRunnerIT.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.utplsql.api;
22

3-
import org.junit.jupiter.api.Disabled;
43
import org.junit.jupiter.api.Test;
54
import org.junit.jupiter.api.function.Executable;
65
import org.utplsql.api.compatibility.CompatibilityProxy;
@@ -65,7 +64,6 @@ void runWithManyReporters() throws SQLException {
6564
/**
6665
* This can only be tested on frameworks >= 3.0.3
6766
*/
68-
@Disabled
6967
@Test
7068
void failOnErrors() throws SQLException, InvalidVersionException {
7169
Connection conn = getConnection();
@@ -82,8 +80,6 @@ void failOnErrors() throws SQLException, InvalidVersionException {
8280

8381
@Test
8482
void runWithRandomExecutionOrder() throws SQLException {
85-
CompatibilityProxy proxy = new CompatibilityProxy(getConnection());
86-
8783
new TestRunner()
8884
.randomTestOrder(true)
8985
.randomTestOrderSeed(123)

src/test/java/org/utplsql/api/reporter/CoverageHTMLReporterAssetTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.utplsql.api.reporter;
22

3-
import org.junit.jupiter.api.Disabled;
43
import org.junit.jupiter.api.Tag;
54
import org.junit.jupiter.api.Test;
65
import org.junit.jupiter.api.io.TempDir;
@@ -25,7 +24,6 @@ private void testFileExists(Path filePath) {
2524
assertTrue(f.exists(), () -> "File " + f + " does not exist");
2625
}
2726

28-
@Disabled("No idea why this ever worked")
2927
@Test
3028
void writeReporterAssetsTo() throws RuntimeException {
3129

0 commit comments

Comments
 (0)