Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create SpaWebFilterIT for reactive app #21041

Merged
merged 15 commits into from
Mar 9, 2023

Conversation

frascu
Copy link
Contributor

@frascu frascu commented Feb 6, 2023

When the app is reactive, SpaWebFilter mutates the request from a general url to /index.html (here). It means that is not a forwarding like in the non-reactive app (here).
Therefore, after the HTTP status assertion, it is not possible to assert the forwarded URL, only the Content Type.

Fixes #21003

@frascu
Copy link
Contributor Author

frascu commented Feb 12, 2023

Hi @mraible,
in the job some tests fail.
I generated the project ng-webflux-psql-default and when I execute the unit tests for SpaWebFilterIt do not fail.
Do you have any suggestion to check and fix?

@mraible
Copy link
Contributor

mraible commented Feb 14, 2023

@frascu If I create webflux-psql with the following JDL:

application {
  config {
    reactive true
    testFrameworks [cypress]
    creationTimestamp 1617901618886
    jwtSecretKey "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ="
  }
  entities *
}

I get two test failures when running mvn verify:

[ERROR] Failures: 
[ERROR]   SpaWebFilterIT.testFilterDoesNotForwardToIndexForApi:34 Response header 'Content-Type' expected:<application/json> but was:<text/plain;charset=UTF-8>
[ERROR]   SpaWebFilterIT.testFilterDoesNotForwardToIndexForV3ApiDocs:40 Status expected:<200 OK> but was:<500 INTERNAL_SERVER_ERROR>
[INFO] 
[ERROR] Tests run: 104, Failures: 2, Errors: 0, Skipped: 0

If I run SpaWebFilterIT in IntelliJ IDEA, I get even more failures.

Screenshot 2023-02-13 at 5 47 46 PM

@mraible
Copy link
Contributor

mraible commented Feb 19, 2023

@frascu Do you see this same behavior if you create an app like I did?

@frascu
Copy link
Contributor Author

frascu commented Feb 21, 2023

I see the same behavior.

In addition, it seems that intellij has the same behavior of this github step.

@frascu
Copy link
Contributor Author

frascu commented Feb 28, 2023

In the GitHub action, the command npm run backend:unit:test is executed, and when the following command is run, some tests fail:

./mvnw -ntp -Dskip.installnodenpm -Dskip.npm verify --batch-mode

However, if the command is run without -Dskip.installnodenpm -Dskip.npm, the tests pass:

./mvnw -ntp verify --batch-mode

Therefore, in this commit ${excludeWebapp} was removed to always use the last command.

In the end, other jobs fail due to an action timeout, which is not related to this issue.

@frascu
Copy link
Contributor Author

frascu commented Mar 7, 2023

@mraible can this pull request be merged or should I change something?

@mraible
Copy link
Contributor

mraible commented Mar 7, 2023

@frascu Can you please fix the conflicts?

# Conflicts:
#	generators/server/files.mjs
mshima
mshima previously requested changes Mar 7, 2023
@mshima mshima dismissed their stale review March 8, 2023 22:12

resolved

@mshima mshima merged commit 9df4568 into jhipster:main Mar 9, 2023
@mshima
Copy link
Member

mshima commented Mar 9, 2023

Thanks @frascu

@frascu
Copy link
Contributor Author

frascu commented Mar 9, 2023

@DanielFran
Copy link
Member

@frascu approved

@DanielFran DanielFran added this to the 8.0.0-beta.1 milestone Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a SpaFilterTestIT for WebFlux
4 participants