-
Notifications
You must be signed in to change notification settings - Fork 2
Min rt functional test bdd #37
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
base: master
Are you sure you want to change the base?
Min rt functional test bdd #37
Conversation
Not deleting existing repos. Adding and deleting only the appbdd-* repos with this test
…ReposAreDeleted FAILED
java.lang.AssertionError at RepositoryTest.groovy:301
Now result is 100% pass
| #Wed Feb 12 10:23:21 PST 2020 | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip | ||
| #distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip | ||
| distributionUrl=https\://mytest.artifactory.com/artifactory/gradle-dist/gradle-7.4.2-all.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you open the project for the first time, you'll get an error:
Unknown host 'mytest.artifactory.com'. You may need to adjust the proxy settings in Gradle. Enable Gradle 'offline mode' and sync project Learn about configuring HTTP proxies in Gradle
|
|
||
| repositories { | ||
| mavenCentral() | ||
| //mavenCentral() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to keep mavenCentral() here. Not sure why there is an Artifacotry instance here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to resolve the dependencies from Artifactory ( preferably the one I was going to run this functional test on). But I agree we can just use mavenCentral() as well.
|
|
||
| b) It does not delete any existing repositories that are already in artifactory. Instead it creates new local, remote and virtual repos ( name prefixed with “appbdd-” ) and after the test is done it deletes only these appbdd-* repos. | ||
|
|
||
| c) I disabled the setBaseURLTest() in src/test/groovy/tests/HealthCheckTest.groovy by changing the group name from "common" to "common-notneeded" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setBaseURLTest() is not only the test, it allows to run some of the Xray tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like your idea to add a condition to not change the BaseUrl if it was already set
| protocol: http:// | ||
| url: localhost:8082 | ||
| external_ip: localhost:8082 | ||
| protocol: https:// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localhost and http allowed the test to run in the CI pipeline with no modifications. I'd rather keep it that way. Also, it shows which port is used by RT if it actually runs on the localhost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure that is fine.
| dependencies { | ||
| implementation 'org.codehaus.groovy:groovy-all:3.0.0' | ||
| implementation 'org.apache.groovy:groovy:4.0.1' | ||
| testImplementation 'junit:junit:4.3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I explicitly used only TestNG in the project to avoid JUnit. Have you added anything specific for JUnit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I did not add any JUnit tests
The partner-integration-tests Gradle test that uses TestNG, RestAssured and Groovy has a limitation / feature that : “The test will delete all existing repositories and create a list of new repos”.
I customized it in the following way ( see min_rt_functional_test_bdd branch) so it is safe to use for a functional test:
❯ gradle --version
Gradle 7.4.2
Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 18 (Oracle Corporation 18+36-2087)
Note: BDD = Behavior Driven Development
For example :
❯ ./gradlew artifactory_ha_test
❯ ./gradlew artifactory_ha_test_with_rmRepos