F# Resistor Color: all tests pass locally but fail on submission server

Code:

module ResistorColor

let colors: string list = [
    "black"; "brown"; "red"; "orange"; "yellow";
    "green"; "blue"; "violet"; "grey"; "white"
]

let colorCode (color: string): int =
    match List.tryFindIndex (fun x -> x = color) colors with
    | Some i -> i
    | None -> -1

local CLI test results:

PS resistor-color> dotnet test 
Running tests from bin\Debug\net10.0\ResistorColor.dll (net10.0|x64)
bin\Debug\net10.0\ResistorColor.dll (net10.0|x64) passed (651ms)

Test run summary: Passed!
  total: 4
  failed: 0
  succeeded: 4
  skipped: 0
  duration: 909ms

Friendly user BNAndras on Discord suggested I bring the issue here.

1 Like

A similar post this week by @birdbrain2734 seems to have a lot more attention: Tests pass locally but fail upon submission without an explanation

Perhaps my issue could be subsumed into the newer one?

Does the fix on that thread help with your problem?

Thanks, @IsaacG. My most recent submission (iteration 6) is now marked “passed.” It does not yet appear among the community solutions.

My previous iterations are marked “failed” even though they each passed all tests locally.

1 Like

That’s great news!

For the publishing bit, that’s run by a different background process separate from the test runner setup. I figure give it a day to show up, and then if it’s not there, that might be worth a separate thread here.

As for the iterations, the test runner only runs the most current code submitted. That’s why only your iteration 6 went from failed to passed. Those other iterations still show as failed, and that tracks because they did fail the test runner. It sucks because those failures weren’t any fault of yours, but you can optionally publish just iteration 6 instead of all the iterations.

1 Like