# Testing package where the test depends on local dev'ed package fails in Julia 1.4.2 with ERROR: can not merge projects

**URL:** https://discourse.julialang.org/t/testing-package-where-the-test-depends-on-local-deved-package-fails-in-julia-1-4-2-with-error-can-not-merge-projects/41611
**Category:** General Usage
**Tags:** package-manager
**Created:** [June 17, 2020, 5:24pm UTC](https://discourse.julialang.org/t/testing-package-where-the-test-depends-on-local-deved-package-fails-in-julia-1-4-2-with-error-can-not-merge-projects/41611 "2020-06-17T17:24:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![alkoedl](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@alkoedl](https://discourse.julialang.org/u/alkoedl)
#### Post date: [June 17, 2020, 5:24pm UTC](https://discourse.julialang.org/t/testing-package-where-the-test-depends-on-local-deved-package-fails-in-julia-1-4-2-with-error-can-not-merge-projects/41611/1 "2020-06-17T17:24:31Z")

</div>

I have a package (say AAA) where the package itself and the tests depend on a local dev’ed package (BBB). Accordingly, I have package BBB both in AAA’s environment and in AAA/test environment like this:

```julia
Project AAA v0.1.0
Status `C:\Data\Projects\AAA\Project.toml`
  [781ca222] BBB v0.5.19 [`..\BBB`]
  [a93c6f00] DataFrames v0.21.2

```

and

```julia
Status `C:\Data\Projects\AAA\test\Project.toml`
  [781ca222] BBB v0.5.19 [`..\..\BBB`]
  [a93c6f00] DataFrames v0.21.2
  [8dfed614] Test

```

When I try to test package AAA using Julia 1.4.2, I get

```julia
(AAA) pkg> test
    Testing AAA
ERROR: can not merge projects

```

The same test runs fine in Julia 1.3.1. So something seems to have changed between 1.3.1 and 1.4.2. How can this be resolved?

This seems to affect local dev’ed packages. Equivalent tests using for example DataFrames works fine.

---

<div class="post-metadata">

### Author: ![alkoedl](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@alkoedl](https://discourse.julialang.org/u/alkoedl)
#### Post date: [June 18, 2020, 8:24am UTC](https://discourse.julialang.org/t/testing-package-where-the-test-depends-on-local-deved-package-fails-in-julia-1-4-2-with-error-can-not-merge-projects/41611/2 "2020-06-18T08:24:37Z")

</div>

Update: The problem goes away, if I use the old style test environment specification for package AAA, i.e., when I remove Project.toml and Manifest.toml from AAA/test and add

```julia
[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]

```

to AAA’s Project.toml.

Unfortunately, I’m not sufficiently familiar with the package manager details to know what exaclty is meant by `ERROR: can not merge projects` (there is no further information). I can only guess that the package manager tries to “merge” package AAA’s normal and test environments when the test directory contains a Project.toml. Then the package manager might get confused because there are references to package BBB with different path specifications (`../BBB` and `../../BBB`). Could this be an explanation?

Although I have a workaround at the moment (use old style test environment spec in AAA), I’d rather stick to the new style, since old style will not be supported from a certain point onward.

I’d appreciate any insight whether this is a bug or a feature or whether my settings are just incorrect somewhere.

Thanks

---

<div class="post-metadata">

### Author: ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)
#### Post date: [June 18, 2020, 11:33am UTC](https://discourse.julialang.org/t/testing-package-where-the-test-depends-on-local-deved-package-fails-in-julia-1-4-2-with-error-can-not-merge-projects/41611/3 "2020-06-18T11:33:23Z")

</div>

You’re not the first: [https://github.com/JuliaLang/Pkg.jl/issues/1585](https://github.com/JuliaLang/Pkg.jl/issues/1585)

The recommendation: Don’t use the Test-Project approach.

---

<div class="post-metadata">

### Author: ![alkoedl](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@alkoedl](https://discourse.julialang.org/u/alkoedl)
#### Post date: [June 18, 2020, 2:30pm UTC](https://discourse.julialang.org/t/testing-package-where-the-test-depends-on-local-deved-package-fails-in-julia-1-4-2-with-error-can-not-merge-projects/41611/4 "2020-06-18T14:30:38Z")

</div>

Thanks a lot for the pointer @laborg. Hadn’t seen this one. Good to know it’s a known issue and it’s being worked on.
