Skip to content

Minor fixes to some integration tests. fixes #1363#1364

Open
Lokowandtg wants to merge 5 commits into
cloudfoundry:5.x.xfrom
Lokowandtg:5.x.x_v2InfoEndpoint
Open

Minor fixes to some integration tests. fixes #1363#1364
Lokowandtg wants to merge 5 commits into
cloudfoundry:5.x.xfrom
Lokowandtg:5.x.x_v2InfoEndpoint

Conversation

@Lokowandtg

Copy link
Copy Markdown
Contributor

InfoTest fails if running against a CF where v2 API is disabled.
OrganizationsTest.getDefaultDomain fails when running in kind-deployment landscape.

The package "serviceInstances" (with capital "I") does not match the package declaration in the contained class. This creates problems in Eclipse on Windows.

InfoTest fails if running against a CF where v2 API is disabled.
OrganizationsTest fails when running in kind-deployment landscape.

The package "serviceInstances" (with capital "I") does not match the package
declaration in the contained class. This creates problems in Eclipse on Windows.
The old docker image was outdated and did not work
on recent docker versions. Switching to the image of
a better supported test application.

@Kehrlann Kehrlann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Lokowandtg

Thanks for your contribution. Surprised that some tests (all the .client.v2 and .operations tests) pass without V2, are you using SKIP_V2_TESTS ? And if so, shouldn't InfoTest be skipped?

// work
@Disabled(
"Await https://github.com/cloudfoundry/cloud_controller_ng/issues/856 for this test to"
+ " work")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

Comment on lines +187 to +199
assertThat(name)
.satisfiesAnyOf(
nameParam ->
assertThat(nameParam)
.contains(
"apps.",
".shepherd.tanzu.broadcom.net"),
nameParam ->
assertThat(nameParam)
.contains(
"apps.",
".127-0-0-1.nip.io")); // when
// testing with kind-deploy.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Can we infer the domain from the TEST_APIHOST env var?

(Not a hard requirement but it'd be nicer than hardcoding deployment options)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. Will do.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

@Disabled("Until Packages are no longer experimental")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

Comment on lines +46 to 55
Version actual;
String version = response.getApiVersion();
if (version == null || version.isEmpty()) {
assertThat("CF API v2 is disabled")
.isEqualTo(response.getSupport());
actual = Version.of(0, 0, 0);
} else {
actual = Version.valueOf(version);
}
assertThat(actual).isLessThanOrEqualTo(expected);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is annotated with @RequiresV2Api. Have you tried the SKIP_V2_TESTS env var? Does it not work as intended?

I'm surprised other test annotated with @RequiresV2Api passed at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the tests pass when v2 is disabled completely. So far v2 is fully functional, but the urls are checked and v2 is refused. This refusal code is disabled locally :-)
Current plan is to remove v2 starting 2027, by then we must be done with the migration.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU the whole org.cloudfoundry.client.v2 package requires CAPI v2 API.

Yes, it should be skipped when setting SKIP_V2_TESTS to true.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SKIP_V2_TESTS works as intended, but I ususally set it to "false" and run all 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.

3 participants