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

anagram-exercise-fix: Added contents to the fetch-cobolcheck{,.ps1} files. #156

Merged
merged 3 commits into from
Jul 30, 2024

Conversation

SimaDovakin
Copy link
Contributor

No description provided.

Copy link

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

If you're interested in learning more about this auto-responder, please read this blog post.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@ErikSchierboom
Copy link
Member

@SimaDovakin I've just created and merged #157, which adds a bin/sync-fetch-cobolcheck-files that copies the bin/fetch-cobolcheck and bin/fetch-cobolcheck.ps1 files to all exercises. Could you:

  1. Rebase this PR
  2. Check if the bin/fetch-cobolcheck and bin/fetch-cobolcheck.ps1 are the most up-to-date versions
  3. Run bin/sync-fetch-cobolcheck-script and update this PR

That way we are certain that all exercises have the same, correct version.

@SimaDovakin
Copy link
Contributor Author

Thank you. I'll do it

@SimaDovakin
Copy link
Contributor Author

I guess, I did rebase, but there is some issue with PowerShell test version. It can't run tests properly (as CI says problem with binary search exercise). I have no idea why. Maybe, I did something wrong.

@ErikSchierboom
Copy link
Member

It looks like it could not download the file:

Invoke-Expression: D:\a\cobol\cobol\exercises\practice\binary-search\test.ps1:11
Line |
  11 |  Invoke-Expression "bin\cobolcheck.exe -p $slug"
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The module 'bin' could not be loaded. For more information, run 'Import-Module bin'.

Could be a GitHub rate limit.

@ErikSchierboom
Copy link
Member

Seems weird that I can find cobolcheck for the other exercises, but not binary-search.

@ErikSchierboom
Copy link
Member

@kapitaali Any idea?

@kapitaali
Copy link
Contributor

In my experience the cobolcheck files work as intended and there's no need to touch them. It is the COBOL source code that needs to be edited instead. I have had many occasions where Win cobolcheck fails, but then after editing the COBOL source it works.

@SimaDovakin
Copy link
Contributor Author

When I try to fetch cobolcheck.exe locally (I use PowerShell on Linux) it is fetched to $HOME/cobolcheck/cobolcheck.exe. Is it intended behavior?

@kapitaali
Copy link
Contributor

I would venture to guess it is not. But can you run the checking in a linux terminal?

@ErikSchierboom
Copy link
Member

When I try to fetch cobolcheck.exe locally (I use PowerShell on Linux) it is fetched to $HOME/cobolcheck/cobolcheck.exe. Is it intended behavior?

I think it is though.

@ErikSchierboom
Copy link
Member

I would probably merge this PR and fix CI in a separate PR.

@SimaDovakin
Copy link
Contributor Author

I would venture to guess it is not. But can you run the checking in a linux terminal?

In a Linux terminal I got some errors which connected to different path separators in Linux and Windows, but magically I can see test results)

@ErikSchierboom ErikSchierboom merged commit f2095c6 into exercism:main Jul 30, 2024
2 of 3 checks passed
@ErikSchierboom
Copy link
Member

Let's merge this PR and then someone can fix the CI error in a follow-up PR.

@kapitaali
Copy link
Contributor

I'm not sure what's wrong but now when I do test.sh on linux it does not fetch it (this used to work out of the box):

./test.sh 
Cobolcheck not found, try to fetch it.
curl: (56) Failure writing output to destination, passed 824 returned 4294967295
./test.sh: line 16: ./bin/cobolcheck: No such file or directory
COMPILE AND RUN TEST
cobc: test.cob: No such file or directory

@SimaDovakin
Copy link
Contributor Author

I'm not sure what's wrong but now when I do test.sh on linux it does not fetch it (this used to work out of the box):

./test.sh 
Cobolcheck not found, try to fetch it.
curl: (56) Failure writing output to destination, passed 824 returned 4294967295
./test.sh: line 16: ./bin/cobolcheck: No such file or directory
COMPILE AND RUN TEST
cobc: test.cob: No such file or directory

Hmm.. @kapitaali Did you run it from track's root? I'll try it tomorrow.

@kapitaali
Copy link
Contributor

no that's the exercism/cobol/anagram directory, trying to test the exercise

@SimaDovakin
Copy link
Contributor Author

When I ran ./test.sh I got this:

 Cobolcheck not found, try to fetch it.                                                                                                                                                        
curl: (23) Failure writing output to destination                                                                                                                                              
./test.sh: line 16: ./bin/cobolcheck: No such file or directory
COMPILE AND RUN TEST
test.cob:167: warning: alphanumeric literal has zero length; a SPACE will be assumed [-Wothers] 
test.cob:214: warning: alphanumeric literal has zero length; a SPACE will be assumed [-Wothers] 
test.cob:313: warning: alphanumeric literal has zero length; a SPACE will be assumed [-Wothers] 
test.cob:413: warning: alphanumeric literal has zero length; a SPACE will be assumed [-Wothers] 
test.cob:435: warning: alphanumeric literal has zero length; a SPACE will be assumed [-Wothers] 
test.cob:457: warning: alphanumeric literal has zero length; a SPACE will be assumed [-Wothers] 
test.cob:481: warning: alphanumeric literal has zero length; a SPACE will be assumed [-Wothers] 
test.cob:505: warning: alphanumeric literal has zero length; a SPACE will be assumed [-Wothers]
TESTSUITE:
Tests for Anagram
     PASS:   1. test_no_matches                                                                 
**** FAIL:   2. test_detect_two_anagrams                                                        
    EXPECTED <lemons,melons>, WAS <>
     PASS:   3. test_does_not_detect_anagram_subsets                                            
**** FAIL:   4. test_detects_anagram                                                            
    EXPECTED <inlets>, WAS <>
**** FAIL:   5. test_three_anagrams                                                             
    EXPECTED <gallery,regally,largely>, WAS <>
**** FAIL:   6. test_detects_multiple_anagrams_with_different_case                              
    EXPECTED <Eons,ONES>, WAS <>
     PASS:   7. test_does_not_detect_non_anagrams_with_identical_checksum                       
**** FAIL:   8. test_detects_anagrams_case_insensitively                                        
    EXPECTED <Carthorse>, WAS <>
**** FAIL:   9. test_detects_anagram_using_case_insensitive_subject                             
    EXPECTED <carthorse>, WAS <>
**** FAIL:  10. test_detects_anagrams_using_case_insensitive_possible_matches                   
    EXPECTED <Carthorse>, WAS <>
     PASS:  11. test_does_not_detect_an_anagram_if_the_original_word_is_repeated                
     PASS:  12. test_anagrams_must_use_all_letters_exactly_once                                 
     PASS:  13. test_words_are_not_anagrams_of_themselves                                       
     PASS:  14. test_words_are_not_anagrams_of_themselves_even_if_letter_case_is_partially_diffe
     PASS:  15. test_words_are_not_anagrams_of_themselves_even_if_letter_case_is_completely_diff
**** FAIL:  16. test_words_other_than_themselves_can_be_anagrams                                
    EXPECTED <Silent>, WAS <>
 
 16 TEST CASES WERE EXECUTED
  8 PASSED
  8 FAILED
=================================================

Interesting. Some tests are not passed now.

@SimaDovakin
Copy link
Contributor Author

I reset my solution to anagram on website and then tested my example solution. All tests are passed.

@SimaDovakin
Copy link
Contributor Author

@kapitaali Maybe, error while fetching cobolcheck occurs because it tries to save cobolcheck to /usr/local/bin/cobolcheck and it requires root permission.

@kapitaali
Copy link
Contributor

kapitaali commented Aug 6, 2024

Ok but that's not the behavior it used to exhibit. It's supposed to download cobolcheck for each execise separately to its ./bin directory.

@SimaDovakin
Copy link
Contributor Author

SimaDovakin commented Aug 6, 2024

@kapitaali I created PR where I reverted fetch-cobolcheck and fetch-cobolcheck.ps1 scripts and ran ./bin/sync-fetch-cobolcheck-files to sync all fetch-cobolcheck scripts within each exercise #158. Now when I run sudo ./bin/test (it works only with root permission) from the repo's root all tests pass. I tried sudo pwsh ./bin/test.ps1 and it also works but with some errors. When I try to run ./test.sh in the anagram exercise's folder not all tests pass but when I ran sudo ./bin/test from repo's root all tests pass. It is weird. In case of ./bin/test.ps1 I got this error Cannot open assembly '/home/simadovakin/my_code/cobol/exercism/cobol/exercises/practice/allergies/bin/cobolcheck.exe': File does not contain a valid CIL image. (I ran it on Linux).

@kapitaali
Copy link
Contributor

kapitaali commented Aug 6, 2024

Alright we need to approve the PR.

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.

3 participants