-
Notifications
You must be signed in to change notification settings - Fork 305
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
Payara-4176 TestContainers+Arquillian+JUnit5 Prototype #4263
Closed
dmatej
wants to merge
56
commits into
payara:master
from
dmatej:PAYARA-4176-TestContainers-prototype
Closed
Payara-4176 TestContainers+Arquillian+JUnit5 Prototype #4263
dmatej
wants to merge
56
commits into
payara:master
from
dmatej:PAYARA-4176-TestContainers-prototype
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MarkWareham
reviewed
Oct 9, 2019
dmatej
changed the title
Payara-4176 TestContainers Prototype
Payara-4176 TestContainers+Arquillian+JUnit5 Prototype
Oct 17, 2019
This was referenced Nov 13, 2019
- removed "random" settings of psSelected/winPsSelected - removed configuration of psSelect from convertNodePswd - created presetNodeAuthSelectBox - enabled autocomplete, without it was configuration hostile except password, which were still remembered by Firefox - fixed nodeButtons.inc - password/keystore gui - fixed UpdateNodeCommand - password/keystore gui, old version used previous version - reimplemented validation - renamed PARAM_REMOTEPASSWORD to PARAM_SSHPASSWORD - ParameterMap - implemented additional methods for better readibility
- report classes have toString now (useful for debugging and logging) - GuiUtil - reduced copy and paste and using sane filtering - RestUtil2 + RestApiHandlers - fixed processing error messages using new method in GuiUtil - expecting JSON, but it will not fail if the response would be unparseable, it would only print error to log.
- added profile FullBuild as the opposite to QuickBuild - added profile manual for manual testing - runs payara server on some mapped local port - mvn clean verify -Ptest-containers,manual -pl :test-containers - can be interrupted by CTRL+C - see target/payara5 - supported docker bases - ubuntu and debian, centos would need more work yet - parts may be moved to test-tools later and can be combined with arquillian - requirement: docker installed
…ara.version - so it is possible to run Payara of different version than I have checked out from the GIT.
…test! - arquillian-junit5 dependency - brings JUnit5+Arquillian integration - WARN: dependency on locally built package! - moved to failsafe, no unit tests here - PayaraDockerArquillianExtension - does not need and does not support any configuration, uses DockerEnvironment - PayaraDockerDeployableContainer - Arquillian extension to support deploy into the docker container - PayaraServerContainer - added useful getters returning basic endpoint URLs - PayaraServerFiles - simplified local access to domain files - KeyStoreManager - wrapper of KeyStore with much nicer API - CertificateRealmITest - base for the test for PAYARA-3793
- tested in Eclipse - still does not work because of known problems with locating resources (that is the purpose of fixEclipseJars.sh, but here it is more complicated, because we would need repack all jars in zip containing resource bundles - added rm -rf and unzip is done inside container - initSslLogging did not work when executed from the test code, use cmd line - reconfigured test logging
- fixed JUL to SLF4j bridge configuration - reconfigured logging on the test side - CertificateRealmITest enhanced test
…name - this set of tests found also a bug in realms, so they don't pass now, because the reset() method is not able to reset realm until instance is restarted
- now you can read it like a book ;) - note yields - all threads and processes are not synchronized, so this is softest possible thing to flush all logs before the next test.
- older versions of payara have broken deployment-client even with another groupId - this dependency also is not released to external maven repositories
- two extension declared on same class - order of methods in order of execution - no need to DockerITest here, bit of a cleanup before another test
… database - database schema not created yet, to be done
- note: this is messy commit before cleanup!!! - support for JDK11 (and JDK8 if it is supported also by the OS) - asadmin output available to tests - reliable detection of in-container network ip address, no russian roulette - docker execution inside docker container - to be removed, depends on docker service on mapped host port - docker must be reconfigured to allow such connections from another network (!) - in effect it is the same docker as on host, so why not executing it directly? - NO! That's why we already have TestContainers, so use it!!! - current implementation has problems: does not remove containers and networks after execution. Each run creates persistent container and network. - (this pseudodiscussion is here only to name all possibilities and their disadvantages) - TempNodesITests - first version, will be changed to use standard GenericContainer even for the temp node - see previous statement to understand problems with this - it is able to test creation and registration of the temp node!
- junit4 removed from mandatory dependencies of all modules - junit4 now must be declared only where it is used - junit4, testng, jmockit - default scope is the test scope - bit of formatting (removed tabs from poms) - easymock upgraded from 3.0 to 4.0.2 - maven-jar-plugin upgraded to 3.1.2 (does not change anything)
- tests DAS administered nodes and instances
- see 215eb8c4cc81efd3e
- good bye, Java EE! - welcome, Jakarta EE!
- EventCollectorAppender - uses special LOG4J's log appender collecting filtered log lines - WaitForExecutable - repeatedly runs executable until it succeeds or times out - JtaTimeoutLoggingITest - checks selected server.log warnings - would need changes if the server.log would change it's format - that's correct :)
- broken and hacked to work at least partially many years ago - formatter used message to hold two values - key and the message, then it split the message into two values. - now EnhancedLogRecord has explicit field for that, no substring magic needed (ODLLogFormatter) - BooleanLatch was replaced by AtomicBoolean and deleted - records which are not loggable from the viewpoint of handler are not processed at all - SysLog, SyslogHandler - formatting, imports, atomic - UniformLogFormatter - removed redundant cache with worse performance and behavior than JDK
- using startupQueue instead of EarlyLogHandler - added FIXME - atomic configuration required to fix issue with race conditions depending on the order of setter calls - these problems were here for years and this cannot fix them, it only "magically" stabilizes the logging system
- Task, LogRotationTimer and PayaraNotificationLogRotationTimer deleted - LogFileRotationImplementation created - LogRotationTimer is abstract - LogRotationTimerTask - new abstract class, children specify time management - UniformLogFormatter - fixed mistake in recent commit (exception) - added unit test - GFFileHandler - rotationRequested removed, it was not used - used api is still allows disabling enabled rotation variant when not asked, it depends on order of method calls.
- faster, no need of synchronized blocks - note: it is not possible to replace millis with Instant or Zoned* or Local*, JUL does not support it. It would be possible only to extend the LogRecord, but then we would duplicate information.
- MeteredStream - moved to own file - LoggingPump - not anonymous any more, can have fields etc.
…, null message possible - EnhancedLogRecord - methods to get OffsetDateTime and print stack trace - FormatterDelegate - added javadoc - MessageResolver, GFFileHandler, ODLLogFormatter, UniformLogFormatter, JSONLogFormatter - extracted and improved copypasted code - ODLLogFormatter - code cleanup - SyslogHandler - trivial cleanup - UniformLogFormatter - code cleanup - AgentFormatterDelegate - only imports, should be visited again; has dependency cycle
- we don't need to see the server.log content, we need only to reliably restart the domain and watch the server.log file - test should not end before all buffers would be flushed to the file
- LOG_END constant accepts log endings for ODL+Uniform log formatters
- payara-jul-extensions - separated HK2 management of logging system and logging system classes - early initialization without HK2 and OSGi - own PayaraLogManager and other classes
- some failing tests ignored for 10 years deleted - fixed dependencies and initialization of logging system in tests - covered scenario without using initializer - surefire now does not trim stacktraces - too often the only way to understand what is wrong - log manager is configurable for tests (PayaraLogManager is not mandatory)
- created enum SshAuthType (KEY/PASSWORD) to distinguish which variant should be saved if we don't set neither password nor keyfile - new parameter sshauthtype to allow switching with defaults
This reverts commit d137915.
- created enum SshAuthType (KEY/PASSWORD) to distinguish which variant should be saved if we don't set neither password nor keyfile - new parameter sshauthtype to allow switching with defaults
…yara Micro - tested with Micro Docker image test
- seems that when we are updating sshauth element, setSshConnector must be already called
I'm closing this PR, but not the branch. The branch is and will be used as an incubator for other issues, and in some future it will split into standalone pull requests. Also TestContainers usage will be refactored, because with new docker images it can build tests on them, not on own (expensive) image. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prototype of tests with the usage of TestContainers, Arquillian and JUnit5
Status
STILL IN PROGRESS!
Dependencies
https://github.com/dmatej/arquillian-junit5-extension (fixed master) (local mvn clean install required)
https://github.com/zforgo/arquillian-junit5-extension (original master)
See Also
arquillian/arquillian-core#137