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

"Tests failed" with no indication of which tests failed #28

Open
himynameisdave opened this issue Dec 1, 2021 · 8 comments
Open

"Tests failed" with no indication of which tests failed #28

himynameisdave opened this issue Dec 1, 2021 · 8 comments
Assignees

Comments

@himynameisdave
Copy link

Hey, not sure if this is an issue with just Swift excersises, but I noticed this issue in both the Freelancer Rates and Vexing Vehicle Purchase exercises.

Whenever I run the tests and have some syntax/compiler error, it will tell me exactly what I did wrong. However (unlike in the Rust exercises or the Layers of Lasagna exercise), I am finding that it will not display which test cases are failing (so I have no idea how to fix them):

image

@kotp
Copy link
Member

kotp commented Dec 11, 2021

Is this still happening for you on this exercise? There was some platform wide things happening that could have caused this to happen as well.

@exercism/swift

@himynameisdave
Copy link
Author

Yep this is still happening for both exercises. Exercises in other tracks (namely the Rust track) will display the test results correctly.

I am working in Firefox, version 95.

@iHiD iHiD transferred this issue from exercism/swift Dec 13, 2021
@iHiD
Copy link
Member

iHiD commented Dec 13, 2021

The data coming back from the test-runner must be incorrect. If anyone from @exercism/swift (or @exercism/reviewers) fancies trying to solve this, that'd be great, otherwise @ErikSchierboom will when he's back in Jan.

@himynameisdave
Copy link
Author

Not sure if this is helpful or not, but I'll include the JSON response from the GET /.../test_run endpoint (with some user ID stuff omitted).

{
  "test_run": {
    "uuid": "<OMITTED>",
    "submission_uuid": "<OMITTED>",
    "version": 0,
    "status": "fail",
    "message": null,
    "message_html": null,
    "output": null,
    "output_html": null,
    "tests": [
      {
        "name": "FreelancerRatesTests.testdailyRateFrom",
        "status": "fail",
        "test_code": null,
        "message": "/mnt/exercism-iteration/Tests/FreelancerRatesTests/FreelancerRatesTests.swift:9: error: FreelancerRatesTests.testdailyRateFrom : XCTAssertEqual failed: (\"1.0\") is not equal to (\"480.0\") +/- (\"0.001\") - ",
        "message_html": "/mnt/exercism-iteration/Tests/FreelancerRatesTests/FreelancerRatesTests.swift:9: error: FreelancerRatesTests.testdailyRateFrom : XCTAssertEqual failed: (\\u0026quot;1.0\\u0026quot;) is not equal to (\\u0026quot;480.0\\u0026quot;) +/- (\\u0026quot;0.001\\u0026quot;) - ",
        "expected": null,
        "output": null,
        "output_html": null
      },
      {
        "name": "FreelancerRatesTests.testmonthlyRoundDown",
        "status": "fail",
        "test_code": null,
        "message": "/mnt/exercism-iteration/Tests/FreelancerRatesTests/FreelancerRatesTests.swift:14: error: FreelancerRatesTests.testmonthlyRoundDown : XCTAssertEqual failed: (\"2.0\") is not equal to (\"12129.0\") +/- (\"0.001\") - ",
        "message_html": "/mnt/exercism-iteration/Tests/FreelancerRatesTests/FreelancerRatesTests.swift:14: error: FreelancerRatesTests.testmonthlyRoundDown : XCTAssertEqual failed: (\\u0026quot;2.0\\u0026quot;) is not equal to (\\u0026quot;12129.0\\u0026quot;) +/- (\\u0026quot;0.001\\u0026quot;) - ",
        "expected": null,
        "output": null,
        "output_html": null
      },
      {
        "name": "FreelancerRatesTests.testmonthlyRoundUp",
        "status": "fail",
        "test_code": null,
        "message": "/mnt/exercism-iteration/Tests/FreelancerRatesTests/FreelancerRatesTests.swift:19: error: FreelancerRatesTests.testmonthlyRoundUp : XCTAssertEqual failed: (\"2.0\") is not equal to (\"12602.0\") +/- (\"0.001\") - ",
        "message_html": "/mnt/exercism-iteration/Tests/FreelancerRatesTests/FreelancerRatesTests.swift:19: error: FreelancerRatesTests.testmonthlyRoundUp : XCTAssertEqual failed: (\\u0026quot;2.0\\u0026quot;) is not equal to (\\u0026quot;12602.0\\u0026quot;) +/- (\\u0026quot;0.001\\u0026quot;) - ",
        "expected": null,
        "output": null,
        "output_html": null
      },
      {
        "name": "FreelancerRatesTests.testworkdaysIn",
        "status": "fail",
        "test_code": null,
        "message": "/mnt/exercism-iteration/Tests/FreelancerRatesTests/FreelancerRatesTests.swift:24: error: FreelancerRatesTests.testworkdaysIn : XCTAssertEqual failed: (\"1.0\") is not equal to (\"35.0\") +/- (\"0.001\") - ",
        "message_html": "/mnt/exercism-iteration/Tests/FreelancerRatesTests/FreelancerRatesTests.swift:24: error: FreelancerRatesTests.testworkdaysIn : XCTAssertEqual failed: (\\u0026quot;1.0\\u0026quot;) is not equal to (\\u0026quot;35.0\\u0026quot;) +/- (\\u0026quot;0.001\\u0026quot;) - ",
        "expected": null,
        "output": null,
        "output_html": null
      },
      {
        "name": "FreelancerRatesTests.testworkdaysShouldRoundDown",
        "status": "fail",
        "test_code": null,
        "message": "/mnt/exercism-iteration/Tests/FreelancerRatesTests/FreelancerRatesTests.swift:30: error: FreelancerRatesTests.testworkdaysShouldRoundDown : XCTAssertEqual failed: (\"1.0\") is not equal to (\"43.0\") +/- (\"0.001\") - ",
        "message_html": "/mnt/exercism-iteration/Tests/FreelancerRatesTests/FreelancerRatesTests.swift:30: error: FreelancerRatesTests.testworkdaysShouldRoundDown : XCTAssertEqual failed: (\\u0026quot;1.0\\u0026quot;) is not equal to (\\u0026quot;43.0\\u0026quot;) +/- (\\u0026quot;0.001\\u0026quot;) - ",
        "expected": null,
        "output": null,
        "output_html": null
      }
    ],
    "highlightjs_language": "swift",
    "links": {
      "self": "<OMITTED>"
    }
  },
  "test_runner_status": {
    "exercise": true,
    "track": true
  }
}

Seems like there are test results, but maybe the front-end isn't handling them correctly?

@iHiD
Copy link
Member

iHiD commented Dec 14, 2021

Thanks. Could you give me the uuid pls?

@hippietrail
Copy link

I'm getting exactly this problem on Vehicle Purchase eight months later on my first day giving exercism a try.

@iHiD
Copy link
Member

iHiD commented Aug 18, 2022

@hippietrail Could you provide the code that results in this please? (cc @ErikSchierboom)

@hippietrail
Copy link

I got the blank result many times, but not every time. Typically I try a couple of lines at a time to see if I'm on track with the syntax rather than trying to implement the whole answer correctly. So excuse my poor answer (-:

func canIBuy(vehicle: String, price: Double, monthlyBudget: Double) -> String {
    let monthlyPayment = price / (5.0 * 12.0)
  
    if monthlyPayment <= monthlyBudget {
        return "Yes! I'm getting a " + vehicle
    } else if monthlyPayment - monthlyBudget <= monthlyBudget / 10.0 {
        return "I'll have to be frugal if I want a " + vehicle        
    } else {
        return "Darn! No " + vehicle + " for me"
    }
}

func licenseType(numberOfWheels wheels: Int) -> String {
  fatalError("Please implement licenseType(numberOfWheels:) function")
}

func registrationFee(msrp: Int, yearsOld: Int) -> Int {
  fatalError("Please implement registrationFee(msrp:yearsOld:) function")
}

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

5 participants