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

Ex12 #108

Merged
merged 22 commits into from
Jun 24, 2020
Merged

Ex12 #108

merged 22 commits into from
Jun 24, 2020

Conversation

igrep
Copy link
Member

@igrep igrep commented Jun 10, 2020

課題12は、初めて標準入力を扱うアプリケーションのverifyを行う必要があったので、Excercise.Coreモジュールを中心に、多くの箇所を書き換えました。
そのため、一時的にex6ブランチから分岐していました。
テストが通り次第マージします。

YAMAMOTO Yuji added 22 commits February 19, 2020 19:20
Next, I have to find a way to get stdout/stderr as a merged ByteString
Use appropriate type synonym for the argument of executeCommand

Fix: Make the command name relative before using it as the part of a temporary directory name

Add a TODO about duplicated code

Add ExitCode to the argument of Judge type

Fix compile errors in the test
@igrep
Copy link
Member Author

igrep commented Jun 10, 2020

またテスト落ちた... 今度は課題12の判定処理(あるいはデータ生成?)のバグだろうか。
レアケースっぽいので出力を記録しておこう。

    === STDOUT:
    *** Failed! Falsifiable (after 11 tests):
    "jJ  7\naVMDWvHTq 6\nvm`iArJBt     10\nTpXRcfjmX 9\nkyDnvana 8\nFis`SzRej  8\n\\W   1\nn    9\nm         7 HL\n"
    Wrong output!
    
    ================================================================================
    Your program's output: ""
          Expected output: "Invalid input: m         7 HL\n"
                For input: "jJ  7\naVMDWvHTq 6\nvm`iArJBt     10\nTpXRcfjmX 9\nkyDnvana 8\nFis`SzRej  8\n\\W   1\nn    9\nm         7 HL\n"
    
    
    FAIL: Your solution didn't pass. Try again!
    HINT: Verified the exercise 12. Note I verify the last `mmlh show`-ed exercise.
    
    Report this failure to ask for a help? (y/n)
    
    === STDERR:
        given the correct answer of exercise 12, show SUCCESS FAILED [1]
        given a wrong answer of exercise 4, show FAIL
        given a not-compilable answer of exercise 4, show FAIL
        given the wrong answer (producing a wrong result given a correct input) of exercise 12, show SUCCESS
        given the wrong answer (producing a wrong result given a wrong input) of exercise 12, show SUCCESS
        given "y" from stdin
          given a not-compilable answer of exercise 5, show FAIL with the URL to submit an issue to haskell-jp/
          given a not-compilable answer of exercise 6, show FAIL with the URL to submit an issue to haskell-jp/
        given nothing from stdin
          given a not-compilable answer of exercise 5, show FAIL without any URL to GitHub.
          given a not-compilable answer of exercise 6, show FAIL without any URL to GitHub.
    
    Failures:
    
      test\\Education\\MakeMistakesToLearnHaskellSpec.hs:150:3: 
      1) Education.MakeMistakesToLearnHaskell, mmlh verify, given the correct answer of exercise 12, show SUCCESS
           predicate failed on: "*** Failed! Falsifiable (after 11 tests):\r\n\"jJ  7\\naVMDWvHTq 6\\nvm`iArJBt     10\\nTpXRcfjmX 9\\nkyDnvana 8\\nFis`SzRej  8\\n\\\\W   1\\nn    9\\nm         7 HL\\n\"\r\nWrong output!\r\n\r\n================================================================================\r\nYour program's output: \"\"\r\n      Expected output: \"Invalid input: m         7 HL\\n\"\r\n            For input: \"jJ  7\\naVMDWvHTq 6\\nvm`iArJBt     10\\nTpXRcfjmX 9\\nkyDnvana 8\\nFis`SzRej  8\\n\\\\W   1\\nn    9\\nm         7 HL\\n\"\r\n\r\n\ESC[91m\r\nFAIL: Your solution didn't pass. Try again!\r\n\ESC[0mHINT: Verified the exercise 12. Note I verify the last `mmlh show`-ed exercise.\r\n\r\nReport this failure to ask for a help? (y/n)\r\n"
    
      To rerun use: --match "/Education.MakeMistakesToLearnHaskell/mmlh verify/given the correct answer of exercise 12, show SUCCESS/"

@igrep
Copy link
Member Author

igrep commented Jun 17, 2020

今日の勉強会で調べたところ、どうもQuickCheckで連続してコマンドを実行した際、たまにコマンドの出力が空文字列として取得されてしまう、という現象が起きているらしい。
概ね数十回に一回程度起きている模様。
typed-processのバグだろうか。現状Windowsでしか再現を確認していない。

@igrep
Copy link
Member Author

igrep commented Jun 17, 2020

再現コードを作るのが非常に面倒でしたがなんとか書いた。
厄介なバグだ...
fpco/typed-process#32

@igrep
Copy link
Member Author

igrep commented Jun 24, 2020

どうも解決するのが難しそうなので、一旦後回しにしてマージします。
別途ワークアラウンドすることをissueにします。

@igrep igrep merged commit 0f790ca into ex6 Jun 24, 2020
@igrep igrep deleted the ex12 branch June 24, 2020 08:28
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.

1 participant