meonkeys commented on code in PR #6410:
URL: https://github.com/apache/fineract/pull/6410#discussion_r4007499851


##########
README.md:
##########
@@ -113,6 +109,50 @@ Expected response for fresh instance:
 {"totalFilteredRecords":0,"pageItems":[]}
 ```
 
+How to run the tests
+---
+
+Unit tests need nothing running:
+
+```bash
+./gradlew test -x :integration-tests:test -x :twofactor-tests:test -x 
:oauth2-tests:test
+```
+
+The integration, two-factor, OAuth2 and Cucumber E2E suites all drive a **live 
Fineract instance over HTTP, and the

Review Comment:
   we want `s/drive/require/` here, right?
   
   Better:
   
   > The integration, two-factor, OAuth2 and Cucumber E2E suites all require a 
live Fineract instance, and the build does not start one for you. Start it 
first or you'll see connection refused errors. The Docker stack is what CI 
uses, so it is the configuration these suites are actually verified against:
   



##########
README.md:
##########
@@ -113,6 +109,50 @@ Expected response for fresh instance:
 {"totalFilteredRecords":0,"pageItems":[]}
 ```
 
+How to run the tests
+---
+
+Unit tests need nothing running:
+
+```bash
+./gradlew test -x :integration-tests:test -x :twofactor-tests:test -x 
:oauth2-tests:test

Review Comment:
   how about if `./gradlew test` runs unit tests (only)? These `-x` exclusions 
are cumbersome.



##########
README.md:
##########
@@ -113,6 +109,50 @@ Expected response for fresh instance:
 {"totalFilteredRecords":0,"pageItems":[]}
 ```
 
+How to run the tests

Review Comment:
   don't have this info in both README.md and CONTRIBUTING.md. We want one 
source of truth. I suggest only having it in CONTRIBUTING.md, and here simply 
say "see CONTRIBUTING.md"



##########
CONTRIBUTING.md:
##########
@@ -75,6 +75,26 @@ See [Cucumber E2E 
Tests](https://fineract.apache.org/docs/current/#testing-cucum
 
 #### Integration tests
 
+Like the Cucumber tests, the integration tests run against a live Fineract 
instance instead of starting one for you.

Review Comment:
   use wording more similar to what's currently in the readme (and that I 
suggest moving here):
   
   "Like the Cucumber tests, the integration tests require a live Fineract 
instance, and the build does not start one for you."



##########
README.md:
##########
@@ -113,6 +109,50 @@ Expected response for fresh instance:
 {"totalFilteredRecords":0,"pageItems":[]}
 ```
 
+How to run the tests
+---
+
+Unit tests need nothing running:
+
+```bash
+./gradlew test -x :integration-tests:test -x :twofactor-tests:test -x 
:oauth2-tests:test
+```
+
+The integration, two-factor, OAuth2 and Cucumber E2E suites all drive a **live 
Fineract instance over HTTP, and the
+build does not start one for you** — start it first, or every test fails on 
connection refused. The Docker stack is
+what CI uses, so it is the configuration these suites are actually verified 
against:
+
+```bash
+# build the image once
+./gradlew :fineract-provider:jibDockerBuild -Djib.to.image=fineract -x test -x 
cucumber
+
+# start Fineract plus its database, LocalStack and the mock OAuth2 server
+docker compose -f docker-compose-postgresql-test.yml up -d
+./gradlew :integration-tests:waitForFineract
+
+./gradlew :integration-tests:test --tests ClientLoanIntegrationTest
+```
+
+Use `docker-compose-mariadb-test.yml` or `docker-compose-mysql-test.yml` for 
the other database engines.
+
+Docker is not a requirement, though. Anything that serves 
`https://localhost:8443/fineract-provider` works just as
+well — `./gradlew devRun` from the Quick Start above, or `ServerApplication` 
from your IDE — since that is the
+address the suites default to. Point them somewhere else with the 
`BACKEND_PROTOCOL`, `BACKEND_HOST` and
+`BACKEND_PORT` environment variables.
+
+`:twofactor-tests` and `:oauth2-tests` need the server started in a different 
authentication mode, so they cannot
+share an instance with `:integration-tests`. Layer the matching override on 
top and recreate the service:
+
+```bash
+docker compose -f docker-compose-postgresql-test.yml -f 
docker-compose-twofactor-test.yml \
+  up -d --force-recreate fineract
+./gradlew :twofactor-tests:test
+```
+
+See [CONTRIBUTING.md](CONTRIBUTING.md#how-to-run-tests) and the
+[Integration 
Testing](https://fineract.apache.org/docs/current/#testing-integration) chapter 
for the rest.

Review Comment:
   link to `/develop/` docs instead of `/current/`



##########
README.md:
##########
@@ -113,6 +109,50 @@ Expected response for fresh instance:
 {"totalFilteredRecords":0,"pageItems":[]}
 ```
 
+How to run the tests
+---
+
+Unit tests need nothing running:
+
+```bash
+./gradlew test -x :integration-tests:test -x :twofactor-tests:test -x 
:oauth2-tests:test

Review Comment:
   Hmm, and they're not working locally like I'd expect. `./gradlew test -x 
:integration-tests:test -x :twofactor-tests:test -x :oauth2-tests:test` fails, 
with:
   
   ```
   $ ./gradlew test -x :integration-tests:test -x :twofactor-tests:test -x 
:oauth2-tests:test
   
   > Configure project :
   matching ref: COMMIT - abed809f14e63fdbc9a818330e990330ea030e86
     ref configuration: COMMIT - pattern: null
       version: 
${describe.tag.version.major}.${describe.tag.version.minor.next}.0-SNAPSHOT
       describeTagPattern: .*(\d+\.\d+\.\d+).*
       describeTagFirstParent: false
   
   project version: 1.16.0-SNAPSHOT
   
   > Task :fineract-tax:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-tax with 
44 managed classes from 2 modules
   
   > Task :fineract-core:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-core with 
40 managed classes from 1 modules
   
   > Task :fineract-cob:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-cob with 
42 managed classes from 2 modules
   
   > Task :fineract-charge:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-charge 
with 47 managed classes from 3 modules
   
   > Task :fineract-rates:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-rates 
with 42 managed classes from 2 modules
   
   > Task :fineract-security:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-security 
with 42 managed classes from 2 modules
   
   > Task :fineract-accounting:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for 
:fineract-accounting with 55 managed classes from 4 modules
   
   > Task :fineract-branch:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-branch 
with 59 managed classes from 5 modules
   
   > Task :fineract-savings:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-savings 
with 82 managed classes from 7 modules
   
   > Task :fineract-investor:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-investor 
with 122 managed classes from 8 modules
   
   > Task :fineract-loan:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-loan with 
114 managed classes from 7 modules
   
   > Task :fineract-progressive-loan:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for 
:fineract-progressive-loan with 117 managed classes from 8 modules
   
   > Task :fineract-working-capital-loan:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for 
:fineract-working-capital-loan with 139 managed classes from 8 modules
   
   > Task :fineract-loan-origination:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for 
:fineract-loan-origination with 142 managed classes from 9 modules
   
   > Task :fineract-provider:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-provider 
with 272 managed classes from 15 modules
   
   > Task :fineract-client:buildAsciidoc
   Cleaned up output directory 
/home/adamm/git/apache/fineract/fineract-client/build/generated/asciidoc before 
code generation.
   There were issues with the specification, but validation has been explicitly 
disabled.
   Errors: 
           -attribute 
paths.'/v1/templates/{templateId}/template'(get).responses.default.description 
is missing
           -attribute 
paths.'/v1/templates/template'(get).responses.default.description is missing
   
   base part for include markup lambda not found: null as 
/home/adamm/.gradle/daemon/9.7.1/null
   base part for include markup lambda not found: null as 
/home/adamm/.gradle/daemon/9.7.1/null
   No application/json content media type found in response. Response examples 
can currently only be generated for application/json media type.
   No application/json content media type found in response. Response examples 
can currently only be generated for application/json media type.
   No application/json content media type found in response. Response examples 
can currently only be generated for application/json media type.
   
############################################################################################
   # Thanks for using OpenAPI Generator.                                        
              #
   # We appreciate your support! Please consider donation to help us maintain 
this project.   #
   # https://opencollective.com/openapi_generator/donate                        
              #
   
############################################################################################
   Successfully generated code to 
/home/adamm/git/apache/fineract/fineract-client/build/generated/asciidoc
   
   > Task :fineract-e2e-tests-runner:test
   
   WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
   WARNING: sun.misc.Unsafe::objectFieldOffset has been called by 
org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor 
(file:/home/adamm/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjweaver/1.9.25.1/a713c790da4d794c7dfb542b550d4e44898d5e23/aspectjweaver-1.9.25.1.jar)
   WARNING: Please consider reporting this to the maintainers of class 
org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor
   WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future 
release
   org.apache.fineract.test.TestRunner
   
     Cucumber
   
       Test initializationError FAILED
   
       feign.RetryableException: Connect to https://localhost:8443 failed: 
Connection refused (connect failed) executing GET 
https://localhost:8443/fineract-provider/api/v1/externalevents/configuration
   
       Caused by: org.apache.hc.client5.http.HttpHostConnectException: Connect 
to https://localhost:8443 failed: Connection refused (connect failed)
   
   
   
   FAILURE: Executed 1 tests in 14.1s (1 failed)
   
   
   1 test completed, 1 failed
   
   > Task :fineract-e2e-tests-runner:test FAILED
   
   [Incubating] Problems report is available at: 
file:///home/adamm/git/apache/fineract/build/reports/problems/problems-report.html
   
   FAILURE: Build failed with an exception.
   
   * What went wrong:
   Execution failed for task ':fineract-e2e-tests-runner:test'.
   > There were failing tests. See the report at: 
file:///home/adamm/git/apache/fineract/fineract-e2e-tests-runner/build/reports/tests/test/index.html
   
   Deprecated Gradle features were used in this build, making it incompatible 
with Gradle 10.
   
   You can use '--warning-mode all' to show the individual deprecation warnings 
and determine if they come from your own scripts or plugins.
   
   For more on this, please refer to 
https://docs.gradle.org/9.7.1/userguide/command_line_interface.html#sec:command_line_warnings
 in the Gradle documentation.
   
   BUILD FAILED in 46s
   214 actionable tasks: 20 executed, 1 from cache, 193 up-to-date
   ```
   
   so then I tried `./gradlew test -x :integration-tests:test -x 
:twofactor-tests:test -x :oauth2-tests:test -x 
:fineract-e2e-tests-runner:test`, but that finishes quickly and doesn't seem to 
have run any tests.
   
   ```
   $ ./gradlew test -x :integration-tests:test -x :twofactor-tests:test -x 
:oauth2-tests:test -x :fineract-e2e-tests-runner:test
   
   > Configure project :
   matching ref: COMMIT - abed809f14e63fdbc9a818330e990330ea030e86
     ref configuration: COMMIT - pattern: null
       version: 
${describe.tag.version.major}.${describe.tag.version.minor.next}.0-SNAPSHOT
       describeTagPattern: .*(\d+\.\d+\.\d+).*
       describeTagFirstParent: false
   
   project version: 1.16.0-SNAPSHOT
   
   > Task :fineract-tax:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-tax with 
44 managed classes from 2 modules
   
   > Task :fineract-cob:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-cob with 
42 managed classes from 2 modules
   
   > Task :fineract-rates:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-rates 
with 42 managed classes from 2 modules
   
   > Task :fineract-core:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-core with 
40 managed classes from 1 modules
   
   > Task :fineract-security:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-security 
with 42 managed classes from 2 modules
   
   > Task :fineract-charge:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-charge 
with 47 managed classes from 3 modules
   
   > Task :fineract-accounting:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for 
:fineract-accounting with 55 managed classes from 4 modules
   
   > Task :fineract-savings:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-savings 
with 82 managed classes from 7 modules
   
   > Task :fineract-branch:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-branch 
with 59 managed classes from 5 modules
   
   > Task :fineract-loan:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-loan with 
114 managed classes from 7 modules
   
   > Task :fineract-progressive-loan:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for 
:fineract-progressive-loan with 117 managed classes from 8 modules
   
   > Task :fineract-investor:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-investor 
with 122 managed classes from 8 modules
   
   > Task :fineract-working-capital-loan:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for 
:fineract-working-capital-loan with 139 managed classes from 8 modules
   
   > Task :fineract-loan-origination:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for 
:fineract-loan-origination with 142 managed classes from 9 modules
   
   > Task :fineract-provider:generateStaticWeavingPersistenceXml
   Generated EclipseLink static weaving persistence.xml for :fineract-provider 
with 272 managed classes from 15 modules
   
   > Task :fineract-client:buildAsciidoc
   Cleaned up output directory 
/home/adamm/git/apache/fineract/fineract-client/build/generated/asciidoc before 
code generation.
   There were issues with the specification, but validation has been explicitly 
disabled.
   Errors: 
           -attribute 
paths.'/v1/templates/{templateId}/template'(get).responses.default.description 
is missing
           -attribute 
paths.'/v1/templates/template'(get).responses.default.description is missing
   
   base part for include markup lambda not found: null as 
/home/adamm/.gradle/daemon/9.7.1/null
   base part for include markup lambda not found: null as 
/home/adamm/.gradle/daemon/9.7.1/null
   No application/json content media type found in response. Response examples 
can currently only be generated for application/json media type.
   No application/json content media type found in response. Response examples 
can currently only be generated for application/json media type.
   
############################################################################################
   # Thanks for using OpenAPI Generator.                                        
              #
   # We appreciate your support! Please consider donation to help us maintain 
this project.   #
   # https://opencollective.com/openapi_generator/donate                        
              #
   
############################################################################################
   Successfully generated code to 
/home/adamm/git/apache/fineract/fineract-client/build/generated/asciidoc
   
   [Incubating] Problems report is available at: 
file:///home/adamm/git/apache/fineract/build/reports/problems/problems-report.html
   
   Deprecated Gradle features were used in this build, making it incompatible 
with Gradle 10.
   
   You can use '--warning-mode all' to show the individual deprecation warnings 
and determine if they come from your own scripts or plugins.
   
   For more on this, please refer to 
https://docs.gradle.org/9.7.1/userguide/command_line_interface.html#sec:command_line_warnings
 in the Gradle documentation.
   
   BUILD SUCCESSFUL in 22s
   211 actionable tasks: 17 executed, 194 up-to-date
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to