Skip to content

Conversation

@kermorgant
Copy link
Contributor

first attempt at using buttercup for some basic tests

@kermorgant kermorgant changed the base branch from master to develop February 22, 2019 08:11
@kermorgant
Copy link
Contributor Author

Hi @zonuexe

I've written a pair of simple tests with buttercup. Travis would be nice to have that automated. Would it be ok for you to give travis access to this repository ?

@zonuexe
Copy link
Member

zonuexe commented Feb 27, 2019

@kermorgant Thank you and LGTM.

Travis would be nice to have that automated. Would it be ok for you to give travis access to this repository ?

👍

@kermorgant
Copy link
Contributor Author

@zonuexe fine. Then I think you need to setup Travis for emacs-php/phpactor.el as I don't seem to have permissions to do that.

@zonuexe
Copy link
Member

zonuexe commented Mar 1, 2019

@kermorgant
I turned the repository on Travis CI. I'm sorry for being late.

@kermorgant
Copy link
Contributor Author

@zonuexe thanks !

@kermorgant kermorgant added help wanted Extra attention is needed question Further information is requested labels Mar 1, 2019
@kermorgant
Copy link
Contributor Author

kermorgant commented Mar 1, 2019

hmm, looking at travis logs, it seems a package is missing.
any idea which one ?
fixed by changing emacs version for travis

@kermorgant kermorgant removed help wanted Extra attention is needed question Further information is requested labels Mar 1, 2019
@kermorgant kermorgant added help wanted Extra attention is needed question Further information is requested labels Mar 1, 2019
@kermorgant
Copy link
Contributor Author

Not tsure what's happening while testing if phpactor is installed correctly. Is there some async code issue ?

@kermorgant kermorgant force-pushed the buttercup branch 3 times, most recently from 2fc3ec3 to 282bd86 Compare March 1, 2019 20:33
(expect (spy-calls-args-for 'composer 0)
:to-equal
'(nil "install" "--no-dev"))
;; (expect return-value :to-be "*compilation*")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test fails, couldn't figure out why

;; (display-warning 'buttercup (format "Buffer content : %s" (buffer-string* "*Messages*")))
;; (dolist (bufname (buffer-list))
;; ;; (display-warning 'buttercup (format "found buffer : %s" bufname)
;; (display-warning 'buttercup (format "buffer content : %s %s" bufname (buffer-string* bufname)))
Copy link
Contributor Author

@kermorgant kermorgant Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no compilation buffer created, and the "composer install" command seemed not to have been run at all (no vendor folder was created)

@kermorgant kermorgant requested a review from zonuexe March 1, 2019 20:37
@kermorgant
Copy link
Contributor Author

kermorgant commented Mar 1, 2019

Hi @zonuexe

I've started using buttercup and cask but it's quite tricky to figure out what's happening behind the scenes once the test is running. I would have liked to test the installation of phpactor from phpactor.el but for some unknown reason, the invocation of composer install --no-dev fails when phpactor-install-or-update is invoked from buttercup.

As you can see in .travis.yml, we could get around by running composer install directly, but that's not great.

Do you have any idea about that ?

EDIT : I found using 'run-buttercup-at-point' within emacs to be really helpful, as the result seems very close to what happens when running buttercup from cask.

After recent experimentation, the issue comes from "composer install" being run async. I need to figure out a way to wait for the end of it before running the expect statement.

add travis conf in order to run buttercup tests

test phpactor installation
test phpactor-get-working-dir (remove unused phpactor-working-dir variable)
test phpactor--lisp-directory and add a fix for it
@kermorgant kermorgant removed help wanted Extra attention is needed question Further information is requested labels Mar 3, 2019
@kermorgant kermorgant changed the title wip: Buttercup Add some tests using buttercup Mar 3, 2019
@kermorgant kermorgant self-assigned this Mar 3, 2019
@kermorgant
Copy link
Contributor Author

Hi @zonuexe

I'm going to merge that in develop, but don't hesitate to add comments if you see something deserving a change.

@kermorgant kermorgant merged commit bbc845f into develop Mar 3, 2019
@kermorgant kermorgant deleted the buttercup branch March 16, 2019 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants