# Pkg3 and testing

**URL:** <https://discourse.julialang.org/t/pkg3-and-testing/11970>\
**Category:** General Usage\
**Created:** [June 26, 2018, 3:04pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970 "2018-06-26T15:04:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![krcools](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krcools/32/10212_2.png) [@krcools](https://discourse.julialang.org/u/krcools)\
**Post date:** [June 26, 2018, 3:04pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970/1 "2018-06-26T15:04:36Z")

</div>

I have checked out a registered package for development:

```julia
(v0.7) pkg>develop CompScienceMeshes

```

I have created a new branch and made some modifications in `.julia/dev/ComScienceMeshes`. Next, I tried to run the unit tests:

```julia
(v0.7) pkg>test CompScienceMeshes

```

This results in error message suggesting my fixes are not taken into account. Inspection of the error output indicates that the code loaded by `test` is the registered version in `packages/slug/CompScienceMeshes` as opposed to the working branch in the tracked development directory `dev/CompScienceMeshes`. Am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [June 26, 2018, 3:17pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970/2 "2018-06-26T15:17:18Z")

</div>

Perhaps you had already loaded the module in the Julia session before making the changes or before you did `develop CompScienceMeshes`?

---

<div class="post-metadata">

**Author:** ![krcools](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krcools/32/10212_2.png) [@krcools](https://discourse.julialang.org/u/krcools)\
**Post date:** [June 26, 2018, 3:24pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970/3 "2018-06-26T15:24:06Z")

</div>

This is possible but I was working under the assumption that `test` spins up a new Julia engine as was the case for `Pkg.test` in `v0.6`.

I played around some more and I got the issue resolved by:

1. committing my changes to git
2. updating: `pkg> up CompScienceMeshes` (this creates a corresponding `packages/new_slug/CompScienceMeshes`)
3. testing: `pkg> test CompScienceMeshes` (this loads from `packages/new_slug/CompScienceMeshes`)

From what you are saying it sounds I should restart Julia to test my modifications. Could `Revise.jl` make this easier?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [June 26, 2018, 3:24pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970/4 "2018-06-26T15:24:57Z")

</div>

> [@krcools](#):
>
> This is possible but I was working under the assumption that `test` spins up a new Julia engine as was the case for `Pkg.test` in `v0.6` .

Yea, that is still the case, nevermind me then 🙂

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 26, 2018, 4:40pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970/5 "2018-06-26T16:40:21Z")

</div>

What does `pkg> st` say? Also can you try `Base.find_package("CompScienceMeshes")`?

---

<div class="post-metadata">

**Author:** ![krcools](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krcools/32/10212_2.png) [@krcools](https://discourse.julialang.org/u/krcools)\
**Post date:** [June 26, 2018, 5:11pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970/6 "2018-06-26T17:11:38Z")

</div>

Status output seems to imply the package location resolves to the development directory:

```julia
(v0.7) pkg> st
    Status `C:\Users\krcools\.julia\environments\v0.7\Project.toml`
  [3e66a162] CompScienceMeshes v0.1.2+ # (C:\Users\krcools\.julia\dev\CompScienceMeshes)

```

Running `Base.find_package` returns the location used by `pkg> test CompScienceMeshes`:

```julia
julia> Base.find_package("CompScienceMeshes")
"C:\\Users\\krcools\\.julia\\packages\\CompScienceMeshes\\IXhQ\\src\\CompScienceMeshes.jl"

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [June 26, 2018, 5:50pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970/7 "2018-06-26T17:50:47Z")

</div>

It looks like you have `add`ed and not `dev`eloped the package. This means it will only be updated when you do an explicit update with new commits. Try `rm` the package and then use `dev` to add it.

---

<div class="post-metadata">

**Author:** ![krcools](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krcools/32/10212_2.png) [@krcools](https://discourse.julialang.org/u/krcools)\
**Post date:** [July 9, 2018, 3:50pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970/8 "2018-07-09T15:50:55Z")

</div>

I indeed first ran `add` and then `dev`. Is this not a very common scenario? First you decide to check out a package, then you find out is has a bug or a missing feature, and then you run `dev` on the same package. Does Pkg3 not allow this chain of events?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [July 9, 2018, 4:16pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970/9 "2018-07-09T16:16:41Z")

</div>

Yes, but it looked like the `dev` didn’t “take”.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [July 9, 2018, 4:29pm UTC](https://discourse.julialang.org/t/pkg3-and-testing/11970/10 "2018-07-09T16:29:42Z")

</div>

Yes, i think this is also related to the bugs experienced in the other threads. When a github tagged version of a package is installed and then the `dev` command is run, then the `environmnets/v0.7/Manifest.toml` is not properly updated to point towards the `dev` path instead of the `repo` on github. One can manually fix this.
