Giter VIP home page Giter VIP logo

jenkiexs's Issues

Change Jenkiexs.Builds.details/2 to be coherent with ! convention

I noticed something in Jenkiexs.Buids.details/2 but didn't want to change in the abovementioned PR because it's not its purpose.

Jenkiexs.Builds.details/2 uses Client.get!/3 as follows:

  def details(job_name, build_number) do
    case Client.get!("/job/#{job_name}/#{build_number}/api/json") do
      %{status_code: 200, body: body} ->
        build = new(job_name, body)
        {:ok, build}

      %{status_code: status, body: body} ->
        {:error, "Got status #{status} with body #{inspect(body)}."}
    end
  end

What do you think about changing that request to Client.get/3 and then creating a Jenkiexs.Builds.details!/2 just to keep the API consistent?

Originally posted by @dflima in #18 (comment)

Help with tests

The lib is in version 0.9 only due to lack of unit tests.

Compilation error in test/support/mock_server/jenkins.ex

After fixing #21, there's a compilation error in test/support/mock_server/jenkins.ex

== Compilation error in file test/support/mock_server/jenkins.ex ==
** (SyntaxError) test/support/mock_server/jenkins.ex:8: syntax error before: '->'
    (elixir) lib/kernel/parallel_compiler.ex:229: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7

The code is as follows:

  get "/api/json" do
    cond do
      is_nil(conn.params["tree"]) ->

      String.match?(conn.params["tree"], ~r/\Ajobs/) ->
        "jobs[name,description,fullName,displayName,fullDisplayName,inQueue,buildable,disabled,nextBuildNumber,property[parameterDefinitions[name,defaultParameterValue[value]]]]"
    end
  end

There's no code block after is_nil(conn.params["tree"]) ->

UndefinedFunctionError on test modules

There are some modules on test/support that are not being compiled when running mix test.

โžœ  jenkiexs git:(master) โœ— mix test
Compiling 7 files (.ex)
Generated jenkiexs app
** (UndefinedFunctionError) function Jenkiexs.MockServer.start/0 is undefined (module Jenkiexs.MockServer is not available)
    Jenkiexs.MockServer.start()
    test/test_helper.exs:1: (file)
    (elixir) lib/code.ex:813: Code.require_file/2

We should add the elixirc_paths attribute on the Jenkiexs.MixProject.project/0 function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.