Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one test depend on the network #140

Closed
teto opened this issue Jun 16, 2022 · 3 comments
Closed

one test depend on the network #140

teto opened this issue Jun 16, 2022 · 3 comments

Comments

@teto
Copy link
Contributor

teto commented Jun 16, 2022

I am trying to enable the tests in nixpkgs for this package (cf NixOS/nixpkgs#169293).
I am almost done but current tests fail with:

Success ||      sqlite.db :delete delete multiple keys with dict for each conditions. V2        
Fail    ||      sqlite.db :select .... pre      
            ...-lua5.1-plenary.nvim-scm-1/share/lua/5.1/plenary/job.lua:106: curl: Executable not found
            stack traceback:
                ...-lua5.1-plenary.nvim-scm-1/share/lua/5.1/plenary/job.lua:106: in function 'new'
                ...lua5.1-plenary.nvim-scm-1/share/lua/5.1/plenary/curl.lua:254: in function 'get'
                /build/sqlite.lua-ade5bc2/test/auto/db_spec.lua:554: in function </build/sqlite.lua-ade5bc2/test/auto/db_spec.lua:552>
                [C]: in function 'xpcall'
                ...a5.1-plenary.nvim-scm-1/share/lua/5.1/plenary/busted.lua:74: in function 'call_inner'
                ...a5.1-plenary.nvim-scm-1/share/lua/5.1/plenary/busted.lua:175: in function 'it'
                /build/sqlite.lua-ade5bc2/test/auto/db_spec.lua:552: in function </build/sqlite.lua-ade5bc2/test/auto/db_spec.lua:548>
                [C]: in function 'xpcall'
                ...a5.1-plenary.nvim-scm-1/share/lua/5.1/plenary/busted.lua:74: in function 'call_inner'
                ...a5.1-plenary.nvim-scm-1/share/lua/5.1/plenary/busted.lua:132: in function 'describe'
                /build/sqlite.lua-ade5bc2/test/auto/db_spec.lua:548: in function </build/sqlite.lua-ade5bc2/test/auto/db_spec.lua:8>
                [C]: in function 'xpcall'
                ...a5.1-plenary.nvim-scm-1/share/lua/5.1/plenary/busted.lua:74: in function 'call_inner'
                ...a5.1-plenary.nvim-scm-1/share/lua/5.1/plenary/busted.lua:120: in function 'describe'
                /build/sqlite.lua-ade5bc2/test/auto/db_spec.lua:8: in main chunk
                [builtin#25]: at 0x7ffff7dd7ad0
                [C]: in function 'pcall'
                ...a5.1-plenary.nvim-scm-1/share/lua/5.1/plenary/busted.lua:221: in function 'run'
                [string ":lua"]:1: in main chunk
            
            stack traceback:
                /build/sqlite.lua-ade5bc2/test/auto/db_spec.lua:554: in function </build/sqlite.lua-ade5bc2/test/auto/db_spec.lua:552>
                
Fail    ||      sqlite.db :select return everything with no params      
            ./lua/sqlite/assert.lua:28: sqlite.lua: can not execute select, posts doesn't exists.

indeed curl is not available because we dont want network access when building/testing from the nix sandbox. Is there a way to skip this test or just add these files to the repository ? It's not the download that is tested but the decoding capability if I understand correctly.

    it(".... pre", function()
      if luv.fs_stat "/tmp/posts" == nil then
        curl.get("https://jsonplaceholder.typicode.com/posts", { output = "/tmp/posts" })
        curl.get("https://jsonplaceholder.typicode.com/users", { output = "/tmp/users" })
      end

Once I get the test passing in nixpkgs, maybe I can port it to the flake if that's of interest

@kkharji
Copy link
Owner

kkharji commented Jun 16, 2022

🤔 perhaps you could check if curl exists and then if so do this test else skip.

@teto
Copy link
Contributor Author

teto commented Jun 18, 2022

fixed in #141

@teto teto closed this as completed Jun 18, 2022
@teto
Copy link
Contributor Author

teto commented Jun 18, 2022

also note that I added it to NixOS/nixpkgs#169293 . The package seems to fail on darwin but I haven't looked why. Maybe because I hardcoded the .so extension of the sqlite library :o

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

No branches or pull requests

2 participants