From e7e1c1965b4da4f23fab7b83897c098c70c5de05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pelayo=20Rojas=20=C3=8D=C3=B1igo?= <31128562+Pelayori@users.noreply.github.com> Date: Fri, 5 Apr 2024 02:27:44 +0200 Subject: [PATCH] Fix code coverage (#167) * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Test coverage fix * Fix multiple cucumber scenarios. Persistent webdriver session * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Test run integration tests * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Add caching back * Fix some tests * Fix some tests * Fix some tests * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. * Test new fixes for coverage. --- .github/workflows/unit-tests-push.yml | 23 ++- database/hsqldb/index.html | 150 ------------------ database/hsqldb/readme.txt | 10 -- pom.xml | 59 ++++--- .../java/com/uniovi/CucumberRunnerTests.java | 1 + .../com/uniovi/steps/NavigateHomeStep.java | 6 + 6 files changed, 53 insertions(+), 196 deletions(-) delete mode 100644 database/hsqldb/index.html delete mode 100644 database/hsqldb/readme.txt diff --git a/.github/workflows/unit-tests-push.yml b/.github/workflows/unit-tests-push.yml index a05c42bd..17e4cfb8 100644 --- a/.github/workflows/unit-tests-push.yml +++ b/.github/workflows/unit-tests-push.yml @@ -47,18 +47,31 @@ jobs: - name: Start the application run: | - ./mvnw spring-boot:run & - sleep 15 + ./mvnw spring-boot:run > logs.txt 2>&1 & + echo $! > spring-boot-app.pid + sleep 5 env: SPRING_DATASOURCE_URL: jdbc:mysql://localhost:3306/test_database SPRING_DATASOURCE_USERNAME: root SPRING_DATASOURCE_PASSWORD: root SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.cj.jdbc.Driver + SPRING_PROFILES_ACTIVE: test - name: Check listening ports run: ss -tuln - - name: Run all tests with sonar analysis + - name: Run tests run: | - ./mvnw -B org.jacoco:jacoco-maven-plugin:prepare-agent clean test sonar:sonar -DEXCLUDE_JUNIT=true -Dsonar.projectKey=Arquisoft_wiq_es04b -Dsonar.organization=arquisoft -Dsonar.branch.name=${{ github.ref }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dspring.profiles.active=test -Dspring.datasource.url=jdbc:mysql://localhost:3306/test_database -Dspring.datasource.username=root -Dspring.datasource.password=root -Dspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -Dtest="com.uniovi.Wiq_UnitTests,com.uniovi.CucumberRunnerTests" + ./mvnw org.jacoco:jacoco-maven-plugin:prepare-agent verify -Dspring.datasource.url=jdbc:mysql://localhost:3306/test_database -Dspring.datasource.username=root -Dspring.datasource.password=root -Dspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver env: SPRING_PROFILES_ACTIVE: test - headless: true \ No newline at end of file + headless: true + EXCLUDE_JUNIT: true + - name: Show app logs + if: always() + run: | + cat logs.txt + - name: Shut down the application + run: | + kill $(cat spring-boot-app.pid) + - name: Collect Jacoco report and send to Sonar + run: | + ./mvnw org.jacoco:jacoco-maven-plugin:report sonar:sonar -Dsonar.projectKey=Arquisoft_wiq_es04b -Dsonar.organization=arquisoft -Dsonar.branch.name=${{ github.ref }} -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Dspring.profiles.active=test \ No newline at end of file diff --git a/database/hsqldb/index.html b/database/hsqldb/index.html deleted file mode 100644 index a8fe5467..00000000 --- a/database/hsqldb/index.html +++ /dev/null @@ -1,150 +0,0 @@ - - -
- -HSQLDB (HyperSQL Database) is a relational - database management system written in Java. Now in its 23rd year, - HSQLDB version 2.7.2 is the result of 12 years - improvements since version 2.0. It offers many features and - adheres closely to the latest SQL and JDBC 4.2 standards.
-This release should be used in preference to earlier 2.x - releases, as it fixes a number of bugs and regressions, as well as - improving functionality and adding new features.
-The main jars in this package are Java module jars and compatible - with Java 11 and later. The alternative jars are compatible with - Java 8 and later. The jars have been tested with JRE 8, 11 and 17. - A separate jar from the web site has the same functionality as - version 2.7.2 minus the java.time features and can be used with Java 6 and 7. -
-The development and maintenance of HyperSQL has been - possible - because of financial contributions by business users. We need - renewed - contributions. Please subscribe to SupportWare at http://hsqldb.org/web/supportware - . Especially if you include HSQLDB as part of an applications that - you sell, - or use it in production, you are expected to subscribe to - SupportWare at the appropriate level. Subscribers get priority for - support and feature requests.
-Hourly paid support for HyperSQL is available - from http://hyperxtreme.co.uk. - This service provides all the help needed to use or integrate - HSQLDB with your application.
-For applications that require more speed with very large data - sets, or need to store more data in a memory database, the - commercial product, HyperXtremeSQL is available - from http://hyperxtreme.co.uk. - This product is fully compatible with HSQLDB SQL queries and JDBC - calls. It also has - extensive SQL OLAP and procedural language features, together with - extra crash-recovery and database management capabilities.
-This download contains the following files and directories:
-bin
-This directory contains some Windows utility wrapper scripts.
-This directory contains the ant - build.xml script and Gradle build files. See the Building HyperSQL Jars - appendix of the HyperSQL User Guide for details.
-When the jar is rebuilt, this - directory contains the *.class files generated by the ANT build - tool. - It does not exist in the distribution zip.
-A set of HTML, PDF and text - documents covering different aspects of HSQLDB and some of its - utilities.
-HyperSQL
- User Guide in HTML format.
- HyperSQL User Guide
- in PDF format.
HyperSQL
- Utilities Guide in HTML format.
- HyperSQL
- Utilities Guide in PDF
- format.
The JavaDoc - for public classes, including the JDBC documentation.
-Chronological list of - minor changes and bug fixes since the release of version 2.0 changelist_2_0.txt -
-HyperSQL source and binaries are released under the 3-clause BSD - license. The license text hsqldb_lic.txt - is for sources developed entirely by the HSQL Development Group. - The hypersonic_lic.txt - is for the few sources that contain code from the closed - HypersonicSQL project.
-The jar needed for running HyperSQL - and its GUI utilities (hsqldb.jar) has been pre-built in this - directory. The jar for SqlTool (sqltool.jar) is - also in this directory. The jars are - compatible with Java version 8 and above. The extra zip file in - the directory is needed - only for - recompiling hsqldb and is not required for deployment.
-All source code is in this directory.
-Contains test scripts for the - database engine and SqlTool. These scripts are run by separate - test - utilities for the engine and SqlTool
-All source code for documentation is in this directory.
-We constantly fix reported issues. Please check the web site - regularly - for latest updated version and latest information. Follow us - on Twitter @hypersql for updates.
-Support documentation for HyperSQL including the FAQ and links to - resources are available - from http://hsqldb.org/support - in various forms, including user forums. Support is given to open - source developers for using HSQLDB in their products.
-This Software is developed and published by the HSQL Development - Group
-Fred Toussi (fredt (at)
- users.sourceforge.net)
- Blaine Simpson (blaine dot simpson (at) admc dot com)