You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/06/04 12:44:40 UTC
[GitHub] [flink] zentol opened a new pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
zentol opened a new pull request #12484:
URL: https://github.com/apache/flink/pull/12484
With this PR it should be possible to run the Java e2e tests in the IDE without having to manually set any property.
For the `moduleDir` property we just use the current working directory, which in IntelliJ is the module that the test resides in, which is exactly what we want.
For `distDir` we move up the module tree and check for the present of `flink-dist`, and then drill down into its `target` directory to find the actual distribution.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638836075
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734",
"triggerID" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 30b3c3dfdc501e2f8c54877d6a9c950e688dfd09 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638836075
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 30b3c3dfdc501e2f8c54877d6a9c950e688dfd09 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638836075
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734",
"triggerID" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 30b3c3dfdc501e2f8c54877d6a9c950e688dfd09 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zentol commented on a change in pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #12484:
URL: https://github.com/apache/flink/pull/12484#discussion_r436067756
##########
File path: flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/LocalStandaloneFlinkResourceFactory.java
##########
@@ -33,19 +37,83 @@
public final class LocalStandaloneFlinkResourceFactory implements FlinkResourceFactory {
private static final Logger LOG = LoggerFactory.getLogger(LocalStandaloneFlinkResourceFactory.class);
+ private static final ParameterProperty<Path> PROJECT_ROOT_DIRECTORY = new ParameterProperty<>("rootDir", Paths::get);
private static final ParameterProperty<Path> DISTRIBUTION_DIRECTORY = new ParameterProperty<>("distDir", Paths::get);
private static final ParameterProperty<Path> DISTRIBUTION_LOG_BACKUP_DIRECTORY = new ParameterProperty<>("logBackupDir", Paths::get);
@Override
public FlinkResource create(FlinkResourceSetup setup) {
Optional<Path> distributionDirectory = DISTRIBUTION_DIRECTORY.get();
if (!distributionDirectory.isPresent()) {
- throw new IllegalArgumentException("The distDir property was not set. You can set it when running maven via -DdistDir=<path> .");
+ // distDir was not explicitly set, let's search for it
+
+ Path projectRootPath;
+ Optional<Path> projectRoot = PROJECT_ROOT_DIRECTORY.get();
+ if (projectRoot.isPresent()) {
+ // running with maven
+ projectRootPath = projectRoot.get();
+ } else {
+ // running in the IDE; working directory is test module
+ Optional<Path> projectRootDirectory = findProjectRootDirectory(Paths.get("").toAbsolutePath());
+ // this distinction is required in case this class is used outside of Flink
+ if (projectRootDirectory.isPresent()) {
+ projectRootPath = projectRootDirectory.get();
+ } else {
+ throw new IllegalArgumentException(
+ "The 'distDir' property was not set and the flink-dist module could not be found automatically." +
+ " Please point the 'distDir' property to the directory containing distribution; you can set it when running maven via -DdistDir=<path> .");
+ }
+ }
+ Optional<Path> distribution = findDistribution(projectRootPath);
+ if (!distribution.isPresent()) {
+ throw new IllegalArgumentException(
+ "The 'distDir' property was not set and a distribution could not be found automatically." +
+ " Please point the 'distDir' property to the directory containing distribution; you can set it when running maven via -DdistDir=<path> .");
+ } else {
+ distributionDirectory = distribution;
+ }
}
Optional<Path> logBackupDirectory = DISTRIBUTION_LOG_BACKUP_DIRECTORY.get();
if (!logBackupDirectory.isPresent()) {
LOG.warn("Property {} not set, logs will not be backed up in case of test failures.", DISTRIBUTION_LOG_BACKUP_DIRECTORY.getPropertyName());
}
return new LocalStandaloneFlinkResource(distributionDirectory.get(), logBackupDirectory.orElse(null), setup);
}
+
+ public static void main(String[] args) {
+ System.out.println(findProjectRootDirectory(Paths.get("").toAbsolutePath()));
+ }
Review comment:
whoops,
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638825584
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit 30b3c3dfdc501e2f8c54877d6a9c950e688dfd09 (Thu Jun 04 12:47:40 UTC 2020)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638836075
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734",
"triggerID" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"triggerType" : "PUSH"
}, {
"hash" : "683c24369ba03611b096aad5c7e9d634c131549b",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2760",
"triggerID" : "683c24369ba03611b096aad5c7e9d634c131549b",
"triggerType" : "PUSH"
}, {
"hash" : "48ca964fb1f2350c6335ab4726553f38a4a4c1c0",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2850",
"triggerID" : "48ca964fb1f2350c6335ab4726553f38a4a4c1c0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 683c24369ba03611b096aad5c7e9d634c131549b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2760)
* 48ca964fb1f2350c6335ab4726553f38a4a4c1c0 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2850)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638836075
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734",
"triggerID" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"triggerType" : "PUSH"
}, {
"hash" : "683c24369ba03611b096aad5c7e9d634c131549b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2760",
"triggerID" : "683c24369ba03611b096aad5c7e9d634c131549b",
"triggerType" : "PUSH"
}, {
"hash" : "48ca964fb1f2350c6335ab4726553f38a4a4c1c0",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2850",
"triggerID" : "48ca964fb1f2350c6335ab4726553f38a4a4c1c0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 48ca964fb1f2350c6335ab4726553f38a4a4c1c0 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2850)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638836075
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734",
"triggerID" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"triggerType" : "PUSH"
}, {
"hash" : "683c24369ba03611b096aad5c7e9d634c131549b",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2760",
"triggerID" : "683c24369ba03611b096aad5c7e9d634c131549b",
"triggerType" : "PUSH"
}, {
"hash" : "48ca964fb1f2350c6335ab4726553f38a4a4c1c0",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "48ca964fb1f2350c6335ab4726553f38a4a4c1c0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 683c24369ba03611b096aad5c7e9d634c131549b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2760)
* 48ca964fb1f2350c6335ab4726553f38a4a4c1c0 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zentol commented on a change in pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #12484:
URL: https://github.com/apache/flink/pull/12484#discussion_r436067636
##########
File path: flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/LocalStandaloneFlinkResourceFactory.java
##########
@@ -33,19 +37,83 @@
public final class LocalStandaloneFlinkResourceFactory implements FlinkResourceFactory {
private static final Logger LOG = LoggerFactory.getLogger(LocalStandaloneFlinkResourceFactory.class);
+ private static final ParameterProperty<Path> PROJECT_ROOT_DIRECTORY = new ParameterProperty<>("rootDir", Paths::get);
private static final ParameterProperty<Path> DISTRIBUTION_DIRECTORY = new ParameterProperty<>("distDir", Paths::get);
private static final ParameterProperty<Path> DISTRIBUTION_LOG_BACKUP_DIRECTORY = new ParameterProperty<>("logBackupDir", Paths::get);
@Override
public FlinkResource create(FlinkResourceSetup setup) {
Optional<Path> distributionDirectory = DISTRIBUTION_DIRECTORY.get();
if (!distributionDirectory.isPresent()) {
- throw new IllegalArgumentException("The distDir property was not set. You can set it when running maven via -DdistDir=<path> .");
+ // distDir was not explicitly set, let's search for it
+
+ Path projectRootPath;
+ Optional<Path> projectRoot = PROJECT_ROOT_DIRECTORY.get();
+ if (projectRoot.isPresent()) {
+ // running with maven
+ projectRootPath = projectRoot.get();
+ } else {
+ // running in the IDE; working directory is test module
+ Optional<Path> projectRootDirectory = findProjectRootDirectory(Paths.get("").toAbsolutePath());
+ // this distinction is required in case this class is used outside of Flink
+ if (projectRootDirectory.isPresent()) {
+ projectRootPath = projectRootDirectory.get();
+ } else {
+ throw new IllegalArgumentException(
+ "The 'distDir' property was not set and the flink-dist module could not be found automatically." +
+ " Please point the 'distDir' property to the directory containing distribution; you can set it when running maven via -DdistDir=<path> .");
+ }
+ }
+ Optional<Path> distribution = findDistribution(projectRootPath);
+ if (!distribution.isPresent()) {
+ throw new IllegalArgumentException(
+ "The 'distDir' property was not set and a distribution could not be found automatically." +
+ " Please point the 'distDir' property to the directory containing distribution; you can set it when running maven via -DdistDir=<path> .");
+ } else {
+ distributionDirectory = distribution;
+ }
}
Optional<Path> logBackupDirectory = DISTRIBUTION_LOG_BACKUP_DIRECTORY.get();
if (!logBackupDirectory.isPresent()) {
LOG.warn("Property {} not set, logs will not be backed up in case of test failures.", DISTRIBUTION_LOG_BACKUP_DIRECTORY.getPropertyName());
}
return new LocalStandaloneFlinkResource(distributionDirectory.get(), logBackupDirectory.orElse(null), setup);
}
+
+ public static void main(String[] args) {
+ System.out.println(findProjectRootDirectory(Paths.get("").toAbsolutePath()));
+ }
+
+ private static Optional<Path> findProjectRootDirectory(Path currentDirectory) {
+ // move up the module structure until we find flink-dist; relies on all modules being prefixed with 'flink'
+ do {
+ if (Files.exists(currentDirectory.resolve("flink-dist"))) {
+ return Optional.of(currentDirectory);
+ }
+ currentDirectory = currentDirectory.getParent();
+ } while (currentDirectory.getFileName().toString().startsWith("flink"));
+ return Optional.empty();
+ }
+
+ private static Optional<Path> findDistribution(Path projectRootDirectory) {
+ final Path distTargetDirectory = projectRootDirectory.resolve("flink-dist").resolve("target");
+ try {
+ Collection<Path> paths = FileUtils.listFilesInDirectory(distTargetDirectory, p -> p.getFileName().toString().contains("flink-dist"));
+ if (paths.size() == 0) {
+ // likely due to flink-dist not having been built
+ return Optional.empty();
+ }
+ if (paths.size() > 1) {
Review comment:
We could harden this be explicitly checking for `flink-dist.jar`; this one should only be in the distribution.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zentol merged pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
zentol merged pull request #12484:
URL: https://github.com/apache/flink/pull/12484
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638836075
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734",
"triggerID" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"triggerType" : "PUSH"
}, {
"hash" : "683c24369ba03611b096aad5c7e9d634c131549b",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2760",
"triggerID" : "683c24369ba03611b096aad5c7e9d634c131549b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 683c24369ba03611b096aad5c7e9d634c131549b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2760)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638836075
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734",
"triggerID" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"triggerType" : "PUSH"
}, {
"hash" : "683c24369ba03611b096aad5c7e9d634c131549b",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "683c24369ba03611b096aad5c7e9d634c131549b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 30b3c3dfdc501e2f8c54877d6a9c950e688dfd09 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734)
* 683c24369ba03611b096aad5c7e9d634c131549b UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638836075
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] tillrohrmann commented on a change in pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on a change in pull request #12484:
URL: https://github.com/apache/flink/pull/12484#discussion_r436017785
##########
File path: flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/LocalStandaloneFlinkResourceFactory.java
##########
@@ -33,19 +37,83 @@
public final class LocalStandaloneFlinkResourceFactory implements FlinkResourceFactory {
private static final Logger LOG = LoggerFactory.getLogger(LocalStandaloneFlinkResourceFactory.class);
+ private static final ParameterProperty<Path> PROJECT_ROOT_DIRECTORY = new ParameterProperty<>("rootDir", Paths::get);
private static final ParameterProperty<Path> DISTRIBUTION_DIRECTORY = new ParameterProperty<>("distDir", Paths::get);
private static final ParameterProperty<Path> DISTRIBUTION_LOG_BACKUP_DIRECTORY = new ParameterProperty<>("logBackupDir", Paths::get);
@Override
public FlinkResource create(FlinkResourceSetup setup) {
Optional<Path> distributionDirectory = DISTRIBUTION_DIRECTORY.get();
if (!distributionDirectory.isPresent()) {
- throw new IllegalArgumentException("The distDir property was not set. You can set it when running maven via -DdistDir=<path> .");
+ // distDir was not explicitly set, let's search for it
+
+ Path projectRootPath;
+ Optional<Path> projectRoot = PROJECT_ROOT_DIRECTORY.get();
+ if (projectRoot.isPresent()) {
+ // running with maven
+ projectRootPath = projectRoot.get();
+ } else {
+ // running in the IDE; working directory is test module
+ Optional<Path> projectRootDirectory = findProjectRootDirectory(Paths.get("").toAbsolutePath());
+ // this distinction is required in case this class is used outside of Flink
+ if (projectRootDirectory.isPresent()) {
+ projectRootPath = projectRootDirectory.get();
+ } else {
+ throw new IllegalArgumentException(
+ "The 'distDir' property was not set and the flink-dist module could not be found automatically." +
+ " Please point the 'distDir' property to the directory containing distribution; you can set it when running maven via -DdistDir=<path> .");
+ }
+ }
+ Optional<Path> distribution = findDistribution(projectRootPath);
+ if (!distribution.isPresent()) {
+ throw new IllegalArgumentException(
+ "The 'distDir' property was not set and a distribution could not be found automatically." +
+ " Please point the 'distDir' property to the directory containing distribution; you can set it when running maven via -DdistDir=<path> .");
+ } else {
+ distributionDirectory = distribution;
+ }
}
Optional<Path> logBackupDirectory = DISTRIBUTION_LOG_BACKUP_DIRECTORY.get();
if (!logBackupDirectory.isPresent()) {
LOG.warn("Property {} not set, logs will not be backed up in case of test failures.", DISTRIBUTION_LOG_BACKUP_DIRECTORY.getPropertyName());
}
return new LocalStandaloneFlinkResource(distributionDirectory.get(), logBackupDirectory.orElse(null), setup);
}
+
+ public static void main(String[] args) {
+ System.out.println(findProjectRootDirectory(Paths.get("").toAbsolutePath()));
+ }
+
+ private static Optional<Path> findProjectRootDirectory(Path currentDirectory) {
+ // move up the module structure until we find flink-dist; relies on all modules being prefixed with 'flink'
+ do {
+ if (Files.exists(currentDirectory.resolve("flink-dist"))) {
+ return Optional.of(currentDirectory);
+ }
+ currentDirectory = currentDirectory.getParent();
+ } while (currentDirectory.getFileName().toString().startsWith("flink"));
+ return Optional.empty();
+ }
+
+ private static Optional<Path> findDistribution(Path projectRootDirectory) {
+ final Path distTargetDirectory = projectRootDirectory.resolve("flink-dist").resolve("target");
+ try {
+ Collection<Path> paths = FileUtils.listFilesInDirectory(distTargetDirectory, p -> p.getFileName().toString().contains("flink-dist"));
+ if (paths.size() == 0) {
+ // likely due to flink-dist not having been built
+ return Optional.empty();
+ }
+ if (paths.size() > 1) {
Review comment:
I guess this works because we first descend recursively in a dfs manner so that we find the `flink/flink-dist/target/flink-1.12-SNAPSHOT-bin/flink-1.12-SNAPSHOT/lib/flink-dist_2.11-1.12-SNAPSHOT.jar`
##########
File path: flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/LocalStandaloneFlinkResourceFactory.java
##########
@@ -33,19 +37,83 @@
public final class LocalStandaloneFlinkResourceFactory implements FlinkResourceFactory {
private static final Logger LOG = LoggerFactory.getLogger(LocalStandaloneFlinkResourceFactory.class);
+ private static final ParameterProperty<Path> PROJECT_ROOT_DIRECTORY = new ParameterProperty<>("rootDir", Paths::get);
private static final ParameterProperty<Path> DISTRIBUTION_DIRECTORY = new ParameterProperty<>("distDir", Paths::get);
private static final ParameterProperty<Path> DISTRIBUTION_LOG_BACKUP_DIRECTORY = new ParameterProperty<>("logBackupDir", Paths::get);
@Override
public FlinkResource create(FlinkResourceSetup setup) {
Optional<Path> distributionDirectory = DISTRIBUTION_DIRECTORY.get();
if (!distributionDirectory.isPresent()) {
- throw new IllegalArgumentException("The distDir property was not set. You can set it when running maven via -DdistDir=<path> .");
+ // distDir was not explicitly set, let's search for it
+
+ Path projectRootPath;
+ Optional<Path> projectRoot = PROJECT_ROOT_DIRECTORY.get();
+ if (projectRoot.isPresent()) {
+ // running with maven
+ projectRootPath = projectRoot.get();
+ } else {
+ // running in the IDE; working directory is test module
+ Optional<Path> projectRootDirectory = findProjectRootDirectory(Paths.get("").toAbsolutePath());
+ // this distinction is required in case this class is used outside of Flink
+ if (projectRootDirectory.isPresent()) {
+ projectRootPath = projectRootDirectory.get();
+ } else {
+ throw new IllegalArgumentException(
+ "The 'distDir' property was not set and the flink-dist module could not be found automatically." +
+ " Please point the 'distDir' property to the directory containing distribution; you can set it when running maven via -DdistDir=<path> .");
+ }
+ }
+ Optional<Path> distribution = findDistribution(projectRootPath);
+ if (!distribution.isPresent()) {
+ throw new IllegalArgumentException(
+ "The 'distDir' property was not set and a distribution could not be found automatically." +
+ " Please point the 'distDir' property to the directory containing distribution; you can set it when running maven via -DdistDir=<path> .");
+ } else {
+ distributionDirectory = distribution;
+ }
}
Optional<Path> logBackupDirectory = DISTRIBUTION_LOG_BACKUP_DIRECTORY.get();
if (!logBackupDirectory.isPresent()) {
LOG.warn("Property {} not set, logs will not be backed up in case of test failures.", DISTRIBUTION_LOG_BACKUP_DIRECTORY.getPropertyName());
}
return new LocalStandaloneFlinkResource(distributionDirectory.get(), logBackupDirectory.orElse(null), setup);
}
+
+ public static void main(String[] args) {
+ System.out.println(findProjectRootDirectory(Paths.get("").toAbsolutePath()));
+ }
+
+ private static Optional<Path> findProjectRootDirectory(Path currentDirectory) {
+ // move up the module structure until we find flink-dist; relies on all modules being prefixed with 'flink'
+ do {
+ if (Files.exists(currentDirectory.resolve("flink-dist"))) {
+ return Optional.of(currentDirectory);
+ }
+ currentDirectory = currentDirectory.getParent();
+ } while (currentDirectory.getFileName().toString().startsWith("flink"));
+ return Optional.empty();
+ }
+
+ private static Optional<Path> findDistribution(Path projectRootDirectory) {
+ final Path distTargetDirectory = projectRootDirectory.resolve("flink-dist").resolve("target");
+ try {
+ Collection<Path> paths = FileUtils.listFilesInDirectory(distTargetDirectory, p -> p.getFileName().toString().contains("flink-dist"));
+ if (paths.size() == 0) {
+ // likely due to flink-dist not having been built
+ return Optional.empty();
+ }
+ if (paths.size() > 1) {
Review comment:
Won't `flink-dist/target` also contain `flink-dist_2.11-1.12-SNAPSHOT.jar`? At least this is the case for me. Can this be a problem?
##########
File path: flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/LocalStandaloneFlinkResourceFactory.java
##########
@@ -33,19 +37,83 @@
public final class LocalStandaloneFlinkResourceFactory implements FlinkResourceFactory {
private static final Logger LOG = LoggerFactory.getLogger(LocalStandaloneFlinkResourceFactory.class);
+ private static final ParameterProperty<Path> PROJECT_ROOT_DIRECTORY = new ParameterProperty<>("rootDir", Paths::get);
private static final ParameterProperty<Path> DISTRIBUTION_DIRECTORY = new ParameterProperty<>("distDir", Paths::get);
private static final ParameterProperty<Path> DISTRIBUTION_LOG_BACKUP_DIRECTORY = new ParameterProperty<>("logBackupDir", Paths::get);
@Override
public FlinkResource create(FlinkResourceSetup setup) {
Optional<Path> distributionDirectory = DISTRIBUTION_DIRECTORY.get();
if (!distributionDirectory.isPresent()) {
- throw new IllegalArgumentException("The distDir property was not set. You can set it when running maven via -DdistDir=<path> .");
+ // distDir was not explicitly set, let's search for it
+
+ Path projectRootPath;
+ Optional<Path> projectRoot = PROJECT_ROOT_DIRECTORY.get();
+ if (projectRoot.isPresent()) {
+ // running with maven
+ projectRootPath = projectRoot.get();
+ } else {
+ // running in the IDE; working directory is test module
+ Optional<Path> projectRootDirectory = findProjectRootDirectory(Paths.get("").toAbsolutePath());
+ // this distinction is required in case this class is used outside of Flink
+ if (projectRootDirectory.isPresent()) {
+ projectRootPath = projectRootDirectory.get();
+ } else {
+ throw new IllegalArgumentException(
+ "The 'distDir' property was not set and the flink-dist module could not be found automatically." +
+ " Please point the 'distDir' property to the directory containing distribution; you can set it when running maven via -DdistDir=<path> .");
+ }
+ }
+ Optional<Path> distribution = findDistribution(projectRootPath);
+ if (!distribution.isPresent()) {
+ throw new IllegalArgumentException(
+ "The 'distDir' property was not set and a distribution could not be found automatically." +
+ " Please point the 'distDir' property to the directory containing distribution; you can set it when running maven via -DdistDir=<path> .");
+ } else {
+ distributionDirectory = distribution;
+ }
}
Optional<Path> logBackupDirectory = DISTRIBUTION_LOG_BACKUP_DIRECTORY.get();
if (!logBackupDirectory.isPresent()) {
LOG.warn("Property {} not set, logs will not be backed up in case of test failures.", DISTRIBUTION_LOG_BACKUP_DIRECTORY.getPropertyName());
}
return new LocalStandaloneFlinkResource(distributionDirectory.get(), logBackupDirectory.orElse(null), setup);
}
+
+ public static void main(String[] args) {
+ System.out.println(findProjectRootDirectory(Paths.get("").toAbsolutePath()));
+ }
Review comment:
I guess this can be removed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #12484: [FLINK-18127][tests] Streamline manual execution of Java E2E tests
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12484:
URL: https://github.com/apache/flink/pull/12484#issuecomment-638836075
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734",
"triggerID" : "30b3c3dfdc501e2f8c54877d6a9c950e688dfd09",
"triggerType" : "PUSH"
}, {
"hash" : "683c24369ba03611b096aad5c7e9d634c131549b",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2760",
"triggerID" : "683c24369ba03611b096aad5c7e9d634c131549b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 30b3c3dfdc501e2f8c54877d6a9c950e688dfd09 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2734)
* 683c24369ba03611b096aad5c7e9d634c131549b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2760)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org