Git Product home page Git Product logo

Comments (15)

Tieske avatar Tieske commented on July 29, 2024

first move into the Kong repo: cd /kong
then install test dependencies: make dev
then run the tests for example bin/busted -v -o gtest /kong-plugin/spec

from kong-vagrant.

slnaing07 avatar slnaing07 commented on July 29, 2024

It's the same process I have been doing, and I still get the "no such file or directory" error,

root@vagrant-ubuntu-trusty-64:/kong# make dev
kong 0.11.2-0 is now installed in /usr/local (license: MIT)

busted 2.0.rc12 already installed, skipping
luacheck 0.20.0 already installed, skipping
lua-llthreads2 0.1.4 already installed, skipping
root@vagrant-ubuntu-trusty-64:/kong# bin/busted -v -o gtest /kong-plugin/spec
: No such file or directory

from kong-vagrant.

Tieske avatar Tieske commented on July 29, 2024

I cannot reproduce this. Do you have the Kong repo cloned?

What does

ls /kong

return?

from kong-vagrant.

slnaing07 avatar slnaing07 commented on July 29, 2024

I have https://github.com/Kong/kong repo cloned inside /kong.

root@vagrant-ubuntu-trusty-64:/kong# ls -l
total 405
-rwxrwxrwx 1 vagrant vagrant    827 Mar 25 04:24 aafcache.lua
drwxrwxrwx 1 vagrant vagrant      0 Mar 23 13:17 bin
-rwxrwxrwx 1 vagrant vagrant 111567 Dec  5 21:37 CHANGELOG.md
-rwxrwxrwx 1 vagrant vagrant   3301 Dec  5 21:37 CODE_OF_CONDUCT.md
-rwxrwxrwx 1 vagrant vagrant    308 Dec  5 21:37 config.ld
-rwxrwxrwx 1 vagrant vagrant  24935 Dec  5 21:37 CONTRIBUTING.md
-rwxrwxrwx 1 vagrant vagrant  15215 Mar 26 01:26 custompluginutils.lua
-rwxrwxrwx 1 vagrant vagrant  27395 Mar 26 01:29 custompluginutilstest.lua
-rwxrwxrwx 1 vagrant vagrant  18630 Mar 22 13:47 hs_err_pid3849.log
-rwxrwxrwx 1 vagrant vagrant  18736 Mar 22 13:47 hs_err_pid3854.log
drwxrwxrwx 1 vagrant vagrant   4096 Mar  9 14:56 kong
-rwxrwxrwx 1 vagrant vagrant  16812 Dec  5 21:37 kong-0.11.2-0.rockspec
-rwxrwxrwx 1 vagrant vagrant  27867 Dec  5 21:37 kong.conf.default
-rwxrwxrwx 1 vagrant vagrant  11547 Dec  5 21:37 LICENSE
-rwxrwxrwx 1 vagrant vagrant    792 Dec  5 21:37 Makefile
-rwxrwxrwx 1 vagrant vagrant    809 Mar  9 14:43 oauthcache.lua
-rwxrwxrwx 1 vagrant vagrant  74287 Dec  7 14:22 output.txt
-rwxrwxrwx 1 vagrant vagrant   3332 Mar 12 18:56 persistentcache.lua
-rwxrwxrwx 1 vagrant vagrant   3366 Mar 16 13:59 processes.txt
-rwxrwxrwx 1 vagrant vagrant  10188 Dec  5 21:37 README.md
-rwxrwxrwx 1 vagrant vagrant    209 Mar 26 00:51 runtime.lua
drwxrwxrwx 1 vagrant vagrant      0 Mar 22 13:41 spec
-rwxrwxrwx 1 vagrant vagrant  35852 Dec  5 21:37 UPGRADE.md

The .lua files are my custom files. Everything else came with the clone/original vagrant image.

from kong-vagrant.

Tieske avatar Tieske commented on July 29, 2024

I cannot reproduce this. Here's my full output from building to running the test

Thijss-MacBook-Pro:kong-vagrant thijs$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...

<<SNIP>>

==> default: fs.file-max = 65536
==> default: Successfully Installed Kong version: 0.13.0
Thijss-MacBook-Pro:kong-vagrant thijs$ vagrant ssh
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-119-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Sun Mar 25 13:47:13 UTC 2018

  System load:  0.15              Processes:           92
  Usage of /:   3.6% of 39.34GB   Users logged in:     0
  Memory usage: 4%                IP address for eth0: 10.0.2.15
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

0 packages can be updated.
0 updates are security updates.


vagrant@vagrant-ubuntu-trusty-64:~$ cd /kong
vagrant@vagrant-ubuntu-trusty-64:/kong$ make dev
Checking stability of dependencies in the absence of
kong 0.13.0-0...

Removing kong 0.13.0-0...
Removal successful.
kong 0.13.0-0 is now installed in /usr/local (license: MIT)

busted 2.0.rc12 not found, installing via luarocks...
Installing https://luarocks.org/busted-2.0.rc12-1.rockspec
Missing dependencies for busted 2.0.rc12-1:
   lua_cliargs == 3.0-1 (not installed)
   luasystem >= 0.2.0-0 (not installed)
   dkjson >= 2.1.0 (not installed)
   say >= 1.3-0 (not installed)
   luassert >= 1.7.8-0 (not installed)
   lua-term >= 0.1-1 (not installed)
   mediator_lua >= 1.1.1-0 (not installed)

busted 2.0.rc12-1 depends on lua_cliargs == 3.0-1 (not installed)
Installing https://luarocks.org/lua_cliargs-3.0-1.src.rock
lua_cliargs 3.0-1 is now installed in /usr/local (license: MIT <http://opensource.org/licenses/MIT>)

busted 2.0.rc12-1 depends on luasystem >= 0.2.0-0 (not installed)
Installing https://luarocks.org/luasystem-0.2.1-0.src.rock
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c src/core.c -o src/core.o
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c src/compat.c -o src/compat.o
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c src/time.c -o src/time.o
gcc -shared -o system/core.so -L/usr/local/openresty/luajit/lib src/core.o src/compat.o src/time.o -lrt
luasystem 0.2.1-0 is now installed in /usr/local (license: MIT <http://opensource.org/licenses/MIT>)

busted 2.0.rc12-1 depends on dkjson >= 2.1.0 (not installed)
Installing https://luarocks.org/dkjson-2.5-2.src.rock
dkjson 2.5-2 is now installed in /usr/local (license: MIT/X11)

busted 2.0.rc12-1 depends on say >= 1.3-0 (not installed)
Installing https://luarocks.org/say-1.3-1.rockspec
say 1.3-1 is now installed in /usr/local (license: MIT <http://opensource.org/licenses/MIT>)

busted 2.0.rc12-1 depends on luassert >= 1.7.8-0 (not installed)
Installing https://luarocks.org/luassert-1.7.10-0.rockspec
luassert 1.7.10-0 is now installed in /usr/local (license: MIT <http://opensource.org/licenses/MIT>)

busted 2.0.rc12-1 depends on lua-term >= 0.1-1 (not installed)
Installing https://luarocks.org/lua-term-0.7-1.rockspec
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c core.c -o core.o
gcc -shared -o term/core.so -L/usr/local/openresty/luajit/lib core.o
lua-term 0.7-1 is now installed in /usr/local (license: MIT/X11)

busted 2.0.rc12-1 depends on mediator_lua >= 1.1.1-0 (not installed)
Installing https://luarocks.org/mediator_lua-1.1.2-0.rockspec
mediator_lua 1.1.2-0 is now installed in /usr/local (license: MIT <http://opensource.org/licenses/MIT>)

busted 2.0.rc12-1 is now installed in /usr/local (license: MIT <http://opensource.org/licenses/MIT>)

luacheck 0.20.0 not found, installing via luarocks...
Installing https://luarocks.org/luacheck-0.20.0-1.src.rock
luacheck 0.20.0-1 is now installed in /usr/local (license: MIT <http://opensource.org/licenses/MIT>)

lua-llthreads2 0.1.4 not found, installing via luarocks...
Installing https://luarocks.org/lua-llthreads2-0.1.4-1.src.rock
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c src/l52util.c -o src/l52util.o -DLLTHREAD_MODULE_NAME=llthreads2
gcc -O2 -fPIC -I/usr/local/openresty/luajit/include/luajit-2.1 -c src/llthread.c -o src/llthread.o -DLLTHREAD_MODULE_NAME=llthreads2
gcc -shared -o llthreads2.so -L/usr/local/openresty/luajit/lib src/l52util.o src/llthread.o -lpthread
lua-llthreads2 0.1.4-1 is now installed in /usr/local (license: MIT/X11)

vagrant@vagrant-ubuntu-trusty-64:/kong$ bin/busted -v -o gtest /kong-plugin/spec
[==========] Running tests from scanned files.
[----------] Global test environment setup.
[----------] Running tests from /kong-plugin/spec/myplugin/01-access_spec.lua
/kong-plugin/spec/myplugin/01-access_spec.lua:7: [postgres error] ERROR: relation "apis" does not exist (13)

stack traceback:
	/kong-plugin/spec/myplugin/01-access_spec.lua:7: in function </kong-plugin/spec/myplugin/01-access_spec.lua:6>

[----------] 0 tests from /kong-plugin/spec/myplugin/01-access_spec.lua (343.20 ms total)

[----------] Global test environment teardown.
[==========] 0 tests from 1 test file ran. (343.83 ms total)
[  PASSED  ] 0 tests.
[  ERROR   ] 1 error, listed below:
[  ERROR   ] /kong-plugin/spec/myplugin/01-access_spec.lua @ 6: Demo-Plugin: myplugin (access) setup

 1 ERROR
vagrant@vagrant-ubuntu-trusty-64:/kong$

from kong-vagrant.

Tieske avatar Tieske commented on July 29, 2024

Can you trace what file is missing according to the error? can't it find bin/busted or is it something within that script that creates the error?

from kong-vagrant.

Tieske avatar Tieske commented on July 29, 2024

@slnaing07 any update?

from kong-vagrant.

slnaing07 avatar slnaing07 commented on July 29, 2024

Tieske- Sorry for the late reply. So I've done the same thing you did- start kong-vagrant from scratch according to the instructions here: https://github.com/Kong/kong-vagrant#running-kong-from-the-source-repo.

Please see the attached file that has the full output. Note that I wasn't able to run anything inside /kong/bin directory, examples on line 1386 and 1472 (both cases say file not found).

full_kong_vagrant_setup.txt

from kong-vagrant.

Tieske avatar Tieske commented on July 29, 2024

vagrant@vagrant-ubuntu-trusty-64:~$ sudo su root

Why this? please don't, many Lua packages end up in the user folder (for 'vagrant') if you switch to root, then they will not be found.

from kong-vagrant.

slnaing07 avatar slnaing07 commented on July 29, 2024

I've set up a new kong-vagrant environment, and this time done it as non-root/vagrant user. The problem still persists where I can't run anything inside /kong/bin directory. Please see the logs below and see if you can spot anything unusual.

full_kong_vagrant_setup.txt

from kong-vagrant.

kimjenk avatar kimjenk commented on July 29, 2024

@slnaing07 A colleague had the same issue with Vagrant on a Windows host. What happened was that all the line endings changed to windows line ending (CRLF). He had the Kong repo in IntelliJ IDEA and changed the line endings on the project to Unix (LF) in IntelliJ IDEA.

I'm not sure if it was his git or IntelliJ IDEA that changed the line enindgs, but changing them back worked.

from kong-vagrant.

Tieske avatar Tieske commented on July 29, 2024

@slnaing07 sorry about the late reply, I completely missed this.

The suggestion by @kimjenk makes sense. afaik the line endings are not relevant for Lua files, it is supposed to be agnostic. But the unix scripts to start/test Kong might not be, I don't know how the shell handles those.

Since in your case kong start works (which is a script installed from within the VM, and it never touched windows), but the scripts in /kong/bin do not (and those are mounted from the host system, which is Windows), it could be the problem.

from kong-vagrant.

Tieske avatar Tieske commented on July 29, 2024

@slnaing07 ping?

from kong-vagrant.

Tieske avatar Tieske commented on July 29, 2024

I just verified that the problem is indeed with line endings. I think if you update the two file in /kong/bin to proper unix line endings it will all work.

Closing this.

from kong-vagrant.

hishamhm avatar hishamhm commented on July 29, 2024

The Kong makefile in master now contains a fix-windows target, so that if line-endings in those scripts get corrupted by Windows, running make fix-windows will fix them.

from kong-vagrant.

Related Issues (20)

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.