# .drone.yml for testing a Julia package

**URL:** <https://drone.discourse.group/t/drone-yml-for-testing-a-julia-package/10029>\
**Category:** Drone Support\
**Created:** [October 2, 2017, 6:33pm UTC](https://drone.discourse.group/t/drone-yml-for-testing-a-julia-package/10029 "2017-10-02T18:33:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![scls19fr](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/scls19fr/32/3661_2.png) [@scls19fr](https://drone.discourse.group/u/scls19fr)\
**Post date:** [October 2, 2017, 6:33pm UTC](https://drone.discourse.group/t/drone-yml-for-testing-a-julia-package/10029/1 "2017-10-02T18:33:55Z")

</div>

Hello,

I’d like to test Julia (JuliaLang) packages using [Drone.io](http://Drone.io) and Gitea (using Docker) in my own network

I created a sample project named “Sample”

```auto
$ julia
               _
   _ _ _(_)_ | A fresh approach to technical computing
  (_) | (_) (_) | Documentation: https://docs.julialang.org
   _ _ _| |_ __ _ | Type "?help" for help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 0.6.0 (2017-06-19 13:05 UTC)
 _/ |\ __'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-apple-darwin13.4.0

julia>
using PkgDev
PkgDev.generate("Sample","MIT")
julia> quit()
$ ls -la ~/.julia/v0.6/Sample/
total 64
drwxr-xr-x 13 scls staff 442 2 oct 20:19 .
drwxr-xr-x 175 scls staff 5950 2 oct 20:21 ..
-rw-r--r-- 1 scls staff 15 2 oct 20:19 .codecov.yml
-rw-r--r-- 1 scls staff 543 2 oct 20:19 .drone.yml
drwxr-xr-x 12 scls staff 408 2 oct 20:19 .git
-rw-r--r-- 1 scls staff 29 2 oct 20:19 .gitignore
-rw-r--r-- 1 scls staff 1098 2 oct 20:19 .travis.yml
-rw-r--r-- 1 scls staff 1170 2 oct 20:19 LICENSE.md
-rw-r--r-- 1 scls staff 448 2 oct 20:19 README.md
-rw-r--r-- 1 scls staff 10 2 oct 20:19 REQUIRE
-rw-r--r-- 1 scls staff 2124 2 oct 20:19 appveyor.yml
drwxr-xr-x 3 scls staff 102 2 oct 20:19 src
drwxr-xr-x 3 scls staff 102 2 oct 20:19 test

```

Here is `.travis.yml`

```auto
$ cat .travis.yml
## Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia
os:
  - linux
  - osx
julia:
  - 0.6
  - nightly
notifications:
  email: false
git:
  depth: 99999999

## uncomment the following lines to allow failures on nightly julia
## (tests will run but not make your overall status red)
#matrix:
# allow_failures:
# - julia: nightly

## uncomment and modify the following lines to manually install system packages
#addons:
# apt: # apt-get for linux
# packages:
# - gfortran
#before_script: # homebrew for mac
# - if [$TRAVIS_OS_NAME = osx]; then brew install gcc; fi

## uncomment the following lines to override the default test script
#script:
# - julia -e 'Pkg.clone(pwd()); Pkg.build("Sample"); Pkg.test("Sample"; coverage=true)'
after_success:
  # push coverage results to Coveralls
  - julia -e 'cd(Pkg.dir("Sample")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
  # push coverage results to Codecov
  - julia -e 'cd(Pkg.dir("Sample")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'

```

I put theses files into my own Gitea repository and put a `.drone.yml` to run continuous integration using [Drone.io](http://Drone.io)

Here is content of my `.drone.yml`

```auto
$ cat .drone.yml
pipeline:
  build:
    image: julia:${JULIA_VERSION}
    commands:
      - julia -e 'Pkg.clone(pwd()); Pkg.build("Sample"); Pkg.test("Sample"; coverage=true)'
      # push coverage results to Coveralls
      #- julia -e 'cd(Pkg.dir("Sample")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
      # push coverage results to Codecov
      #- julia -e 'cd(Pkg.dir("Sample")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'

matrix:
  JULIA_VERSION:
    - 0.6
    - nightly

```

Drone build is failing with the following error log:

```auto
+ julia -e 'Pkg.clone(pwd()); Pkg.build("Sample"); Pkg.test("Sample"; coverage=true)'
0s
2
INFO: Initializing package repository /root/.julia/v0.6
5s
3
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
5s
4
ERROR: can't determine package name from URL: /drone/src/192.168.1.5:3000/scls/Sample.jl/compare/faea32df72bef6a9f28533eedd4b0ecb9eaa8564...5989864c97316d0799088fe533f0ec95e88f5be7
26s
5
Stacktrace:
26s
6
 [1] url_and_pkg(::String) at ./pkg/entry.jl:217
27s
7
 [2] clone at ./pkg/entry.jl:221 [inlined]
27s
8
 [3] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#clone,Tuple{String}})() at ./pkg/dir.jl:36
27s
9
 [4] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#clone,Tuple{String}}, ::String) at ./file.jl:70
27s
10
 [5] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N} where N) at ./pkg/dir.jl:36
27s
11
 [6] clone(::String) at ./pkg/pkg.jl:169

```

Do you have any idea of what is causing this ?

Kind regards

---

<div class="post-metadata">

**Author:** ![scls19fr](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/scls19fr/32/3661_2.png) [@scls19fr](https://drone.discourse.group/u/scls19fr)\
**Post date:** [October 2, 2017, 6:49pm UTC](https://drone.discourse.group/t/drone-yml-for-testing-a-julia-package/10029/2 "2017-10-02T18:49:18Z")

</div>

This question is cross-posted on [https://discourse.julialang.org/t/continuous-integration-with-drone-io/6203](https://discourse.julialang.org/t/continuous-integration-with-drone-io/6203) to get highlight from Julia dev / users.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [October 2, 2017, 7:03pm UTC](https://drone.discourse.group/t/drone-yml-for-testing-a-julia-package/10029/3 "2017-10-02T19:03:33Z")

</div>

drone uses your canonical repository name (eg `github.com/foo/bar`) as the clone path. In your case, the canonical repository name includes a port, which does not play well with Julia. You can override the default clone path of your container by setting the workspace path:

```auto
workspace:
  src: scls/Sample.jl

```

---

<div class="post-metadata">

**Author:** ![scls19fr](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/scls19fr/32/3661_2.png) [@scls19fr](https://drone.discourse.group/u/scls19fr)\
**Post date:** [October 3, 2017, 9:19am UTC](https://drone.discourse.group/t/drone-yml-for-testing-a-julia-package/10029/4 "2017-10-03T09:19:00Z")

</div>

Sorry but I’m still getting same issue

```auto
+ julia -e 'Pkg.clone(pwd()); Pkg.build("Sample"); Pkg.test("Sample"; coverage=true)'
0s
2
INFO: Initializing package repository /root/.julia/v0.6
8s
3
INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl
8s
4
ERROR: can't determine package name from URL: /drone/src/192.168.1.5:3000/scls/Sample.jl/compare/05650cb8a8e6e90682fa1edaed9d4b3fd44896f1...9b7cfb486972bb6d9ea9aedfe313a21dee0a58a8
25s
5
Stacktrace:
25s
6
 [1] url_and_pkg(::String) at ./pkg/entry.jl:217
25s
7
 [2] clone at ./pkg/entry.jl:221 [inlined]
25s
8
 [3] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#clone,Tuple{String}})() at ./pkg/dir.jl:36
25s
9
 [4] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#clone,Tuple{String}}, ::String) at ./file.jl:70
25s
10
 [5] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N} where N) at ./pkg/dir.jl:36
25s
11
 [6] clone(::String) at ./pkg/pkg.jl:169

```

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [October 3, 2017, 3:07pm UTC](https://drone.discourse.group/t/drone-yml-for-testing-a-julia-package/10029/5 "2017-10-03T15:07:25Z")

</div>

I still see the port in your clone path, which tells me the workspace is still not configured correctly.

```nohighlight
ERROR: can't determine package name from URL: /drone/src/192.168.1.5:3000

```

You can see examples for using the workspace here:  
[http://docs.drone.io/workspace/](http://docs.drone.io/workspace/)
