Skip to content

Conversation

@sureshvenkatesan
Copy link

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:

  1. upgraded to run with :
    ❯ 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)
  2. Now it does not delete all existing repositories. Instead it creates new local, remote and virtual repos ( prefixed with “appbdd-*” ) and after the test is done it deletes only these repos.
    Note: BDD = Behavior Driven Development
  3. The test report is saved in partner-integration-tests/build/reports/tests/artifactory_ha_test/index.html or partner-integration-tests/build/reports/tests/artifactory_ha_test_with_rmRepos/classes/tests.RepositoryTest.html depending on the test you run
    For example :
    ❯ ./gradlew artifactory_ha_test
    ❯ ./gradlew artifactory_ha_test_with_rmRepos

@danielmkn danielmkn self-requested a review May 3, 2022 01:00
#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
Copy link
Collaborator

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()
Copy link
Collaborator

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.

Copy link
Author

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"
Copy link
Collaborator

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.

Copy link
Author

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://
Copy link
Collaborator

@danielmkn danielmkn May 3, 2022

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.

Copy link
Author

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'
Copy link
Collaborator

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?

Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants