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

v5.1 crashes with "Found duplicated test names" #211

Closed
haf opened this issue Dec 5, 2017 · 15 comments
Closed

v5.1 crashes with "Found duplicated test names" #211

haf opened this issue Dec 5, 2017 · 15 comments

Comments

@haf
Copy link
Owner

haf commented Dec 5, 2017

 Found duplicated test names, these names are: [ ... ]

--help displays no way to override. I want to run my tests (they are grouped with mutexes rather than names in this case)

@AnthonyLloyd
Copy link
Contributor

Are these blocking you? If not I'll hold off to see if there are any others.

@haf
Copy link
Owner Author

haf commented Dec 6, 2017

Well, it stopped me from upgrading and I froze Expecto with < 5.1, but I can continue to use old versions.

@AnthonyLloyd
Copy link
Contributor

I understand. Its really a breaking change. I'll release tonight.

@forki
Copy link
Contributor

forki commented Dec 14, 2017

image

there are two tests. With different names. But expecto complains. What can I do?

@forki
Copy link
Contributor

forki commented Dec 14, 2017

basically I have

let t1 = testList "list1" [ testCase "a" (fun _ -> ()) ]
let t2 = testList "list2" [ testCase "b" (fun _ -> ()) ]

let all = testList "all" [ t1; t2 ]

all
|> runTestsWithArgs defaultConfig args

@forki
Copy link
Contributor

forki commented Dec 14, 2017

this should not fail.

@AnthonyLloyd
Copy link
Contributor

AnthonyLloyd commented Dec 14, 2017

O no. I'll look at it today/tomorrow. You can use the allow_duplicate_names config to turn it off for now in 5.1.1.

@AnthonyLloyd AnthonyLloyd reopened this Dec 14, 2017
@forki
Copy link
Contributor

forki commented Dec 14, 2017

scratch that. I fucked up. It works as expecto-ed.

@AnthonyLloyd
Copy link
Contributor

AnthonyLloyd commented Dec 14, 2017

Cool! I'm stupid also, I forgot I added a test to check exactly this.

Closing...

@Alxandr
Copy link

Alxandr commented Jan 18, 2018

This patch fix was a breaking change that makes the TestSdk integration no longer work. Updating the configuration object will cause anyone who creates their own configuration instead of just using the defaultConfig to break.

@haf
Copy link
Owner Author

haf commented Jan 18, 2018

Perhaps we should introduce an interface that the record implements? After all, keeping binary compatibility would be a very important thing to anything depending on this project.

@Alxandr
Copy link

Alxandr commented Jan 18, 2018

Or hide it's impelementation; only exposing factory/accessors/wither functions. Maybe even lenses could work. Normally, adding properties to an object isn't a problem; but the issue with records is that doing so also adds new parameters to the constructor. We could go with something like:

let myConfig =
     defaultConfig
  |> Optics.set Config.fsCheckMaxTests 200
  |> Optics.set Config.fsCheckStartSize 2
  |> Optics.set Config.mySpiritIsWeak true

It's obviously much more verbose, but still; it would make it much easier to keep binary compatibility. If you make an interface, people are going to implement it... Also, you have the same issue whenever you want to extend the interface. By making the type opaque, this issue goes away. Whenever you add a new property, you also need to make a new lense, which is just a new static property on a class.

@AnthonyLloyd
Copy link
Contributor

Can't we do what FAKE and other projects do and just change things we know about off defaultConfig?

{ defaultConfig with
        Configuration = configuration
        Framework = framework
        Project = project
    }

@Alxandr
Copy link

Alxandr commented Jan 18, 2018

I don't think that works actually (though not sure). Cause it still compiles it down to invoking either the constructor, or pre-defined "with" methods as far as I know.

See doStuff method here: https://sharplab.io/#v2:DYLgZgzgNAJiDUAfALgTwA4FMAEBhA9gHZjYC82A3gLABQ22hAjCNhMgE4CWhA5rfYQBMLbsmwBfftlrBMYmJjABDAK7BkBYmUoNG2gERh8+fQG4Gg7YwAME2jLnYY+AMrIVYEgAoAlNqmyYgC2qJok5BROiqrqYdgA7pzIABYW2gAslpJ02CFhQA===

It compiles to new Conf(defaultConf.n1, newN2). If you break the constructor, this will still fail.

@AnthonyLloyd
Copy link
Contributor

I guess adding to the config is currently a breaking change and needs a major version.

It looks like we really need to resolve the developer API.

We have #204. There is also adamchester/expecto-adapter#37 which I think needs to be considered at the same time.

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

4 participants