Skip to content

Comments

Remove a created file in test#736

Merged
ko1 merged 1 commit intoruby:masterfrom
znz:remove-created-file
Aug 16, 2022
Merged

Remove a created file in test#736
ko1 merged 1 commit intoruby:masterfrom
znz:remove-created-file

Conversation

@znz
Copy link
Member

@znz znz commented Aug 16, 2022

Do not leave a created file in the home directory after test.

Description

I tried changing home directory in previous pull request.
But GitHub Actions environment cannot allow to change home directory.

https://github.com/ruby/actions/runs/7843995832?check_suite_focus=true#step:17:3353

    > eval error: Permission denied @ rb_sysopen - /home/runner/foo.rb

So I will try another solution that allow temporarily changing home directory in tests.
And then I found remaining ~/foo.rb.

https://github.com/ruby/actions/runs/7848993435?check_suite_focus=true#step:19:27

+ diff -u /tmp/stat-before-tests.txt /tmp/stat-after-tests.txt
--- /tmp/stat-before-tests.txt	2022-08-16 01:05:14.740220993 +0000
+++ /tmp/stat-after-tests.txt	2022-08-16 01:13:22.767165216 +0000
@@ -14,6 +14,7 @@
 ["/home/runner/.profile", "100644", 1, 1001, 121, 807, "2b9ee6d446f8f9ffccaab42b6df5649f749a9a07"]
 ["/home/runner/.rustup", "40755", 6, 1001, 121, 4096, nil]
 ["/home/runner/factory", "40755", 2, 1001, 0, 4096, nil]
+["/home/runner/foo.rb", "100644", 1, 1001, 121, 38, "9b900ad84347f369a72cfa234fb93d56852ed2ac"]
 ["/home/runner/perflog", "40755", 2, 1001, 121, 4096, nil]
 ["/home/runner/runners", "40755", 4, 1001, 0, 4096, nil]
 ["/home/runner/warmup", "40755", 2, 1001, 0, 4096, nil]

This pull request tries to delete a created file in the home directory.

Do not leave a created file in the home directory after test.
@ko1
Copy link
Collaborator

ko1 commented Aug 16, 2022

TODO: limited to allow modification only on ruby/debug Github actions by checking `GITHUB_REPOSITORY == 'ruby/debug'``

@ko1 ko1 merged commit 2cb4448 into ruby:master Aug 16, 2022
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.

2 participants