From 8de1500a25d1e43cd6ed26b4d93f956651b53b6a Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sun, 6 Mar 2022 14:52:15 -0300 Subject: tests: don't download sailor Use a small fixture instead to test the regression for sailorproject/sailor#138 Sailor was the largest rock downloaded by the test suite, so this should improve download times. --- spec/fixtures/a_repo/non_lua_file-1.0-1.rockspec | 22 ++++++++++++++++++++++ spec/fixtures/a_repo/non_lua_file-1.0-1.src.rock | Bin 0 -> 852 bytes spec/fixtures/a_repo/non_lua_file-1.0-2.rockspec | 22 ++++++++++++++++++++++ spec/fixtures/a_repo/non_lua_file-1.0-2.src.rock | Bin 0 -> 852 bytes spec/install_spec.lua | 10 +++++----- 5 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 spec/fixtures/a_repo/non_lua_file-1.0-1.rockspec create mode 100644 spec/fixtures/a_repo/non_lua_file-1.0-1.src.rock create mode 100644 spec/fixtures/a_repo/non_lua_file-1.0-2.rockspec create mode 100644 spec/fixtures/a_repo/non_lua_file-1.0-2.src.rock diff --git a/spec/fixtures/a_repo/non_lua_file-1.0-1.rockspec b/spec/fixtures/a_repo/non_lua_file-1.0-1.rockspec new file mode 100644 index 00000000..51ef42eb --- /dev/null +++ b/spec/fixtures/a_repo/non_lua_file-1.0-1.rockspec @@ -0,0 +1,22 @@ +-- regression test for sailorproject/sailor#138 +rockspec_format = "3.0" +package = "non_lua_file" +version = "1.0-1" +source = { + url = "file://../upstream/non_lua_file-1.0.tar.gz" +} +description = { + summary = "An example rockspec that has a script.", +} +dependencies = { + "lua >= 5.1", +} +build = { + type = "builtin", + modules = {}, + install = { + lua = { + ["sailor.blank-app.htaccess"] = "src/sailor/blank-app/.htaccess", + } + } +} diff --git a/spec/fixtures/a_repo/non_lua_file-1.0-1.src.rock b/spec/fixtures/a_repo/non_lua_file-1.0-1.src.rock new file mode 100644 index 00000000..148f7038 Binary files /dev/null and b/spec/fixtures/a_repo/non_lua_file-1.0-1.src.rock differ diff --git a/spec/fixtures/a_repo/non_lua_file-1.0-2.rockspec b/spec/fixtures/a_repo/non_lua_file-1.0-2.rockspec new file mode 100644 index 00000000..f9d2e2c6 --- /dev/null +++ b/spec/fixtures/a_repo/non_lua_file-1.0-2.rockspec @@ -0,0 +1,22 @@ +-- regression test for sailorproject/sailor#138 +rockspec_format = "3.0" +package = "non_lua_file" +version = "1.0-2" +source = { + url = "file://../upstream/non_lua_file-1.0.tar.gz" +} +description = { + summary = "An example rockspec that has a script.", +} +dependencies = { + "lua >= 5.1", +} +build = { + type = "builtin", + modules = {}, + install = { + lua = { + ["sailor.blank-app.htaccess"] = "src/sailor/blank-app/.htaccess", + } + } +} diff --git a/spec/fixtures/a_repo/non_lua_file-1.0-2.src.rock b/spec/fixtures/a_repo/non_lua_file-1.0-2.src.rock new file mode 100644 index 00000000..06eb9ac0 Binary files /dev/null and b/spec/fixtures/a_repo/non_lua_file-1.0-2.src.rock differ diff --git a/spec/install_spec.lua b/spec/install_spec.lua index 9bc94eb6..ea6e1d3f 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua @@ -22,11 +22,11 @@ local extra_rocks = { "/wsapi-1.6-1.src.rock", "/luafilesystem-1.6.3-2.src.rock", "/luafilesystem-1.6.3-1.src.rock", - "/sailor-0.5-3.src.rock", - "/sailor-0.5-4.src.rock", "spec/fixtures/a_repo/has_build_dep-1.0-1.all.rock", "spec/fixtures/a_repo/a_build_dep-1.0-1.all.rock", "spec/fixtures/a_repo/a_rock-1.0-1.src.rock", + "spec/fixtures/a_repo/non_lua_file-1.0-1.src.rock", + "spec/fixtures/a_repo/non_lua_file-1.0-2.src.rock", } describe("luarocks install #integration", function() @@ -183,11 +183,11 @@ describe("luarocks install #integration", function() end) it('handle non-Lua files in build.install.lua when upgrading sailorproject/sailor#138', function() - assert.is_true(run.luarocks_bool("install sailor 0.5-3 --deps-mode=none")) + assert.is_true(run.luarocks_bool("install non_lua_file 1.0-1 --deps-mode=none")) assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess")) assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess~")) - assert.is_true(run.luarocks_bool("install sailor 0.5-4 --deps-mode=none")) + assert.is_true(run.luarocks_bool("install non_lua_file 1.0-2 --deps-mode=none")) assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess")) assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess~")) end) @@ -281,7 +281,7 @@ describe("luarocks install #integration", function() describe("#build_dependencies", function() it("install does not install a build dependency", function() - assert(run.luarocks_bool("install has_build_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) + assert(run.luarocks_bool("install has_build_dep")) assert(run.luarocks_bool("show has_build_dep 1.0")) assert.falsy(run.luarocks_bool("show a_build_dep 1.0")) end) -- cgit v1.2.3-55-g6feb