azagrebin commented on a change in pull request #11285:  [FLINK-16189][e2e] 
Remove test logic from FlinkDistribution
URL: https://github.com/apache/flink/pull/11285#discussion_r387615044
 
 

 ##########
 File path: 
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/LocalStandaloneFlinkResource.java
 ##########
 @@ -51,16 +58,28 @@
 
        private static final Logger LOG = 
LoggerFactory.getLogger(LocalStandaloneFlinkResource.class);
 
-       private final FlinkDistribution distribution = new FlinkDistribution();
+       private final TemporaryFolder temporaryFolder = new TemporaryFolder();
+       private final Path distributionDirectory;
+       @Nullable
+       private final Path logBackupDirectory;
        private final FlinkResourceSetup setup;
 
-       LocalStandaloneFlinkResource(FlinkResourceSetup setup) {
+       private FlinkDistribution distribution;
+
+       LocalStandaloneFlinkResource(Path distributionDirectory, Optional<Path> 
logBackupDirectory, FlinkResourceSetup setup) {
+               this.distributionDirectory = distributionDirectory;
+               this.logBackupDirectory = logBackupDirectory.orElse(null);
                this.setup = setup;
        }
 
        @Override
        public void before() throws Exception {
-               distribution.before();
+               temporaryFolder.create();
+               Path tmp = temporaryFolder.newFolder().toPath();
+               LOG.info("Copying distribution to {}.", tmp);
+               TestUtils.copyDirectory(distributionDirectory, tmp);
+
+               distribution = new FlinkDistribution(tmp);
 
 Review comment:
   `distribution = createFlinkDistribution();`

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to