Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts are not executable when using exercism download #45

Closed
0xE282B0 opened this issue Jul 26, 2022 · 8 comments
Closed

Scripts are not executable when using exercism download #45

0xE282B0 opened this issue Jul 26, 2022 · 8 comments

Comments

@0xE282B0
Copy link
Member

0xE282B0 commented Jul 26, 2022

Hi,
I was checking out the cobol track as a user and found the following problem on a Mac:

> exercism download --exercise=reverse-string --track=cobol
> cd ~/Exercism/cobol/reverse-string
> ./test.sh 
zsh: permission denied: ./test.sh

In this git repo the scrips have execute flags, but when using exercism download the scripts are not executable.
Has someone experience with scripts from other tracks? Do we need to declare them somewhere as executables?

@KTSnowy
Copy link
Contributor

KTSnowy commented Jul 26, 2022

That's weird, it's working in the CI tests so they should still have the executable flag I think.

I'll try running it on my Mac

@KTSnowy
Copy link
Contributor

KTSnowy commented Jul 26, 2022

hello-world % ./test.sh
zsh: permission denied: ./test.sh

I'm getting the same issue on the hello-world exercise on a Mac.

@KTSnowy
Copy link
Contributor

KTSnowy commented Jul 26, 2022

@0xE282B0 the test.sh has the executable flag when executing directly from the track repo, but not when downloading from the Exercism CLI

@axtens
Copy link
Member

axtens commented Jul 27, 2022

So are you executing this in the root of every task?

git update-index --chmod=+x ./test.sh 
git update-index --chmod=+x ./bin/fetch-cobolcheck

You may well be, and if you are then "Houston, we have a problem!"

@KTSnowy
Copy link
Contributor

KTSnowy commented Jul 27, 2022

Wait, are we supposed to execute those two commands?

@axtens
Copy link
Member

axtens commented Jul 27, 2022

I have been

@0xE282B0
Copy link
Member Author

In this repository all the exec flags are fine. To set them with those two commands is very important when you are working on Windows to make the CI work.

However, my problem is that when I'm using the exercism CLI tool, like a student, then I have no exec flags anymore.
I found out, that this behavior is intended and here is a good summary on the discussion: exercism/cli#903 (comment)

I can change the scripts that we use bash test.sh to start the tests instead of ./test.sh.
Or we open an issue in the https://github.com/exercism/cli/ repo. Other tracks like ruby or groovy and kotlin, have similar problems.

0xE282B0 added a commit to 0xE282B0/cobol that referenced this issue Jul 27, 2022
@0xE282B0
Copy link
Member Author

@KTSnowy the official way to execute a test on a UNIX fs is now bash test.sh.

axtens pushed a commit that referenced this issue Jul 27, 2022
* [TEST-RUNNER]: Adjust test scripts for test runner and fix #45

Signed-off-by: Sven Pfennig <[email protected]>

* minor fixes

Signed-off-by: Sven Pfennig <[email protected]>
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

No branches or pull requests

3 participants