[
https://issues.apache.org/jira/browse/GOBBLIN-1292?focusedWorklogId=502299&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-502299
]
ASF GitHub Bot logged work on GOBBLIN-1292:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 19/Oct/20 15:32
Start Date: 19/Oct/20 15:32
Worklog Time Spent: 10m
Work Description: sv2000 commented on pull request #3131:
URL:
https://github.com/apache/incubator-gobblin/pull/3131#issuecomment-712247761
> @sv2000 : This works.
> A suggestion: Did you consider factoring out the temp directory generator
into another class (perhaps in the module: gobblin-test-utils) and have every
test use it directly?
>
> Usage might look like:
>
> TestDirectoryManager dirMgr = new TestDirectoryManager(this.getClass());
// this sets up the root path, attaches to the calling class.
> this.taskStateFile = dirMgr.getDirectoryPath("/taskState/_RUNNING");
Thanks @shirshanka ! Yes, I did think of re-factoring the tmp dir creation.
However, I did not see much of a benefit (in terms of avoiding code
duplication) since the equivalent of the "TestDirectoryManager" needs to be
duplicated whenever a tmp dir is created. Further, the tmp dir creation is
really only 2 lines of code - one to create the directory itself and one for
marking the dir for deletion.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 502299)
Time Spent: 0.5h (was: 20m)
> Undo hardcoded tmp directory locations for unit tests
> -----------------------------------------------------
>
> Key: GOBBLIN-1292
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1292
> Project: Apache Gobblin
> Issue Type: Improvement
> Components: misc
> Affects Versions: 0.15.0
> Reporter: Sudarshan Vasudevan
> Priority: Major
> Fix For: 0.15.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Several unit tests in Gobblin make use of hardcoded tmp directory locations.
> If these locations are not cleaned up, they have the potential to cause test
> failures in subsequent builds. Further, hardcoded locations may potentially
> collide with other tests which may accidentally use the same location. This
> task modifies a host of tests to use dynamically generated temp directories
> which are automatically cleaned up when tests complete.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)