-
Notifications
You must be signed in to change notification settings - Fork 102
Remove formula tmp dir #875
Remove formula tmp dir #875
Conversation
Signed-off-by: Kadu Artur Prussek <[email protected]>
Signed-off-by: Kadu Artur Prussek <[email protected]>
Signed-off-by: Kadu Artur Prussek <[email protected]>
Signed-off-by: Kadu Artur Prussek <[email protected]>
Signed-off-by: Kadu Artur Prussek <[email protected]>
can you make an issue and link to your project? |
@@ -166,20 +158,6 @@ func (pr PreRunManager) loadConfig(formulaPath string, def formula.Definition) ( | |||
return formulaConfig, nil | |||
} | |||
|
|||
func (pr PreRunManager) createWorkDir(home, formulaPath string, def formula.Definition) (string, error) { | |||
tDir := def.TmpWorkDirPath(home) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to remove this method from pkg/formula
if got != nil || tt.out.err != nil { | ||
assert.EqualError(t, tt.out.err, got.Error()) | ||
} | ||
|
||
_ = os.Chdir(pwd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we test for file creation on the correct dir? This is the purpose of this PR correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which file? this PR just stops copying the /bin
folder of a formula to a tmp folder.
local := NewRunner(in.inputResolver, in.preRun, in.fileManager, in.env, homeDir) | ||
got := local.Run(in.def, api.Prompt, false, nil) | ||
|
||
if tt.out.err != nil && got != nil && tt.out.err.Error() != got.Error() { | ||
t.Errorf("Run(%s) got %v, want %v", tt.name, got, tt.out.err) | ||
if tt.want != nil || got != nil { | ||
assert.EqualError(t, got, tt.want.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just requesting since it was already approved
Signed-off-by: Kadu Artur Prussek <[email protected]>
/merge qa |
It would be interesting to simulate an execution that creates a file and checks its creation on the correct folder |
Signed-off-by: Kadu Artur Prussek <[email protected]>
2259b48
Signed-off-by: Kadu Artur Prussek <[email protected]>
I fixed this bug in this commit |
Signed-off-by: Kadu Artur Prussek <[email protected]>
fileCreted := filepath.Join(formulaPath, "test.txt") | ||
assert.FileExists(t, fileCreted) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- fileCreated
@@ -153,86 +153,6 @@ func TestPreRun(t *testing.T) { | |||
err: errors.New("invalid character 'e' looking for beginning of value"), | |||
}, | |||
}, | |||
{ | |||
name: "create work dir error", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code deletion ❤️
/merge qa |
🔥 Merge Conflict |
/merge qa |
👌 Merged branch performance/remove_tmp_dir into qa |
Signed-off-by: Kadu Artur Prussek <[email protected]>
The implementation is breaking on Windows, just create a formula and run to see |
Signed-off-by: Kadu Artur Prussek <[email protected]>
Signed-off-by: Kadu Artur Prussek <[email protected]>
Signed-off-by: Kadu Artur Prussek <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #875 +/- ##
==========================================
- Coverage 85.31% 84.64% -0.68%
==========================================
Files 113 112 -1
Lines 4039 4018 -21
==========================================
- Hits 3446 3401 -45
- Misses 413 433 +20
- Partials 180 184 +4
Continue to review full report at Codecov.
|
/merge qa |
👌 Merged branch performance/remove_tmp_dir into qa |
This reverts commit 0ca725c.
Description
The need to copy the formula to a temporary folder has been removed, thus reducing the necessary IO when executing a formula.
How to verify it
This improvement should not change the functionality of the rit.
Changelog
Performance - remove tmp dir to formulas