josephwilk/amrita

Plan to catch up with Elixir

Closed this issue · 23 comments

Joseph, do you have any plans to catch up with Elixir versions? If so, any timeline?

I plan to catch up but it is not a priority at the moment and I have no timeline.

Contributions always welcome.

Joseph,

Thats unfortunate about the lack of priority. Yes, you were good bringing in my last contribution, so I now understand I’ll have to do the work myself.

Thanks for your response.

Regards,
Steve

On Jul 16, 2014, at 2:15 PM, Joseph Wilk notifications@github.com wrote:

I plan to catch up but it is not a priority at the moment and I have no timeline.

Contributions always welcome.


Reply to this email directly or view it on GitHub.

2cents,

would be great if you caught stable Elixir and hex'ified Amrita.

@herenowcoder @smpallen99 Noted.
I'll block some time on Friday to attack this. I may not get all the way but should make a very good start.

Great, good luck then!

Elixir-1.0.0 has been released ... time to start fixing :)

Great a stable release to target! Fantastic.
Thanks for the pointer!

So I've spent some time at least getting to the point where Amrita's tests run under 1.0.0.

I've not looked at the failures yet, currently 29 failing tests.
https://github.com/josephwilk/amrita/tree/chasing-elixir-master

Commit here: ab8f874

make ci

There is a little feature change around hooks and a couple of mix parameters which will not work.
I'm also only using the documentation formatter currently.

If anyone feels like having a go at any of those failures, it should be a easier now that the build runs under 1.0.0.

A big step closer to supporting 1.0.0 :)

Hmm still fails compiling:

lowks@lowkster ~/src/elixir/Radpath $ MIX_ENV=test mix deps.compile amrita                                                      13:03
==> amrita
warning: the dependency amrita requires Elixir "~> 0.13.0" but you are running on v1.0.0

== Compilation error on file lib/amrita/checkers/exceptions.ex ==
** (CompileError) lib/amrita/checkers/exceptions.ex:23: invalid rescue clause. The clause should match on an alias, a variable or be in the `var in [alias]` format
    (elixir) src/elixir_exp_clauses.erl:22: :elixir_exp_clauses.clause/5
    (elixir) src/elixir_exp_clauses.erl:209: anonymous fn/5 in :elixir_exp_clauses.expand_without_export/5
    (stdlib) lists.erl:1237: :lists.map/2
    (elixir) src/elixir_exp_clauses.erl:212: :elixir_exp_clauses.expand_without_export/5
    (stdlib) lists.erl:1237: :lists.map/2
    (stdlib) lists.erl:1237: :lists.map/2
    (elixir) src/elixir_exp_clauses.erl:108: :elixir_exp_clauses.try/3
    (elixir) src/elixir.erl:175: :elixir.erl_eval/3
** (RuntimeError) cannot use ExUnit.Case without starting the ExUnit application, please call ExUnit.start() or explicitly start the :ex_unit app
    (ex_unit) expanding macro: ExUnit.Case.__using__/1
    test/radpath_test.exs:25: RadpathTests (module)
    (elixir) expanding macro: Kernel.use/2
    test/radpath_test.exs:25: RadpathTests (module)
    (elixir) expanding macro: Kernel.if/2
    test/radpath_test.exs:25: RadpathTests (module)
    expanding macro: Amrita.Sweet.__using__/1
    test/radpath_test.exs:25: RadpathTests (module)

make: *** [test] Error 1

@lowks Are you using the branched version of Amrita?

If you run:

git clone -b "chasing-elixir-master" git@github.com:josephwilk/amrita.git && cd amrita && make ci

do you get the same result?

@josephwilk running the exact command gives me this:

Failures:

  1) test about checkers with no expected argument - supports ! and positive form (Integration.CheckerFacts)
     test/integration/t_checkers.exs:12
     ** (CompileError) test/integration/t_checkers.exs:13: undefined function thousand/1
     stacktrace:
       (elixir) src/elixir.erl:206: :elixir.quoted_to_erl/3
       (elixir) src/elixir.erl:157: :elixir.eval_forms/4
       (elixir) lib/code.ex:166: Code.eval_quoted/3
       test/integration/t_checkers.exs:13

  2) test about collection matchers - has_suffix (Integration.AmritaFacts)
     test/integration/t_amrita.exs:187
     ** (ArgumentError) argument error
     stacktrace:
       :erlang.tuple_to_list([3, 4, 5])
       (amrita) lib/amrita/checkers/collection.ex:109: Amrita.Checkers.Collections.has_suffix/2
       test/integration/t_amrita.exs:190

  3) test ! negates the predicate - raises (Integration.AmritaFacts)
     test/integration/t_amrita.exs:317
     ** (ArgumentError) argument error
     stacktrace:
       (amrita) lib/amrita/checkers/simple.ex:222: Amrita.Checkers.Simple.!/2
       test/integration/t_amrita.exs:318

  4) test about collection matchers - has_prefix (Integration.AmritaFacts)
     test/integration/t_amrita.exs:170
     ** (ArgumentError) argument error
     stacktrace:
       :erlang.tuple_to_list([4, 5])
       (amrita) lib/amrita/checkers/collection.ex:66: Amrita.Checkers.Collections.has_prefix/2
       test/integration/t_amrita.exs:173

  5) test about collection matchers - hash suffix with Sets (Integration.AmritaFacts)
     test/integration/t_amrita.exs:200
     ** (Amrita.FactError) Expected:
          #HashSet<[2, 3]> |> has_suffix(1,2,3)                                                                                       
     stacktrace:
       (amrita) lib/amrita/message.ex:10: Amrita.Message.fail/3
       test/integration/t_amrita.exs:201

  6) test about collection matchers - has_prefix with Sets (Integration.AmritaFacts)
     test/integration/t_amrita.exs:183
     ** (Amrita.FactError) Expected:
          #HashSet<[2, 1]> |> has_prefix(1,2,3)                                                                                       
     stacktrace:
       (amrita) lib/amrita/message.ex:10: Amrita.Message.fail/3
       test/integration/t_amrita.exs:184

  7) test check unstubbed module was preserved after stub (Integration.MockFacts)
     test/integration/t_mocks.exs:18
     ** (UndefinedFunctionError) undefined function: Integration.MockFacts.Polite.swear?/0 (module Integration.MockFacts.Polite is not available)
     stacktrace:
       Integration.MockFacts.Polite.swear?()
       test/integration/t_mocks.exs:19

  8) test about `mix amrita` - appends runtime when trace option is specified (Integration.Mix)
     test/integration/t_mix.exs:45
     ** (File.Error) could not write to file tmp/test/t_pants_trace.exs: no such file or directory
     stacktrace:
       (elixir) lib/file.ex:635: File.write!/3
       test/integration/t_mix.exs:46

  9) test about `mix amrita` - supports running tests at a specific line number (Integration.Mix)
     test/integration/t_mix.exs:36
     ** (File.Error) could not write to file tmp/test/t_pants.exs: no such file or directory
     stacktrace:
       (elixir) lib/file.ex:635: File.write!/3
       test/integration/t_mix.exs:37

 10) test |> supports expected value as a var (PipelineFacts)
     test/unit/amrita/elixir/t_pipeline.exs:11
     ** (CompileError) test/unit/amrita/elixir/t_pipeline.exs:21: undefined function example/1
     stacktrace:
       (elixir) src/elixir.erl:206: :elixir.quoted_to_erl/3
       (elixir) src/elixir.erl:157: :elixir.eval_forms/4
       (elixir) lib/code.ex:166: Code.eval_quoted/3
       test/unit/amrita/elixir/t_pipeline.exs:21

Finished in 2.2 seconds (1.6s on load, 0.6s on tests)
make: *** [ci_1.0.0] Error 1

@lowks Great, thats what I would expect. Those are failing tests left to attack.

  1. test about checkers with no expected argument - supports ! and positive form (Integration.CheckerFacts)
  2. test |> supports expected value as a var (PipelineFacts)

Adding brachets: (), these tests have pass
i.e.

b |> example()
1000 |> thousand()

The solution without bracket has not been found yet….

  1. test about mix amrita - appends runtime when trace option is specified (Integration.Mix)
  2. test about mix amrita - supports running tests at a specific line number (Integration.Mix)

Test code has been executed following order:

  1. into facts "about mix amrita"
  2. run setup function
  3. run on_exit function
  4. into fact "supports running tests at a specific line number"

after "tmp/test" directory had been deleted, fact was executed.
Therefore, writing file fail.

Great, thanks @ritalin . Fancy submitting a pull request?

PR reesolving 2), 4), 5) and 6) have submitted for chasing-elixir-master branch.
#113

Thanks to @seankay we are down:

  • 3 - 5 failures.

Final bug hurdle is investigating the inconsistency in failures between runs. If this relates to order based tests or if this is a bug in the runner.

Consistency issue fixed for now.

4 failing tests left:

  • test about checkers with no expected argument - supports ! and positive form (Integration.CheckerFacts)
  • test check again that unstubbed module was preserved after stub (Integration.MockFacts)
  • test check unstubbed module was preserved after stub (Integration.MockFacts)
  • test |> supports expected value as a var (PipelineFacts)

And with that all tests are green and I've merged to master.

I'll let that sit a little while before cutting a release.

Thanks to everyone who contributed to getting this release green!

👍

cool :] thx