diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2022-03-06 14:52:15 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2022-03-06 23:04:20 -0300 |
| commit | 8de1500a25d1e43cd6ed26b4d93f956651b53b6a (patch) | |
| tree | cb81173c4b06b28efbb035df110beb123a4b98eb | |
| parent | 2fac17d4d211adf9c1fe9668094febb55ee92389 (diff) | |
| download | luarocks-8de1500a25d1e43cd6ed26b4d93f956651b53b6a.tar.gz luarocks-8de1500a25d1e43cd6ed26b4d93f956651b53b6a.tar.bz2 luarocks-8de1500a25d1e43cd6ed26b4d93f956651b53b6a.zip | |
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.
| -rw-r--r-- | spec/fixtures/a_repo/non_lua_file-1.0-1.rockspec | 22 | ||||
| -rw-r--r-- | spec/fixtures/a_repo/non_lua_file-1.0-1.src.rock | bin | 0 -> 852 bytes | |||
| -rw-r--r-- | spec/fixtures/a_repo/non_lua_file-1.0-2.rockspec | 22 | ||||
| -rw-r--r-- | spec/fixtures/a_repo/non_lua_file-1.0-2.src.rock | bin | 0 -> 852 bytes | |||
| -rw-r--r-- | spec/install_spec.lua | 10 |
5 files changed, 49 insertions, 5 deletions
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 @@ | |||
| 1 | -- regression test for sailorproject/sailor#138 | ||
| 2 | rockspec_format = "3.0" | ||
| 3 | package = "non_lua_file" | ||
| 4 | version = "1.0-1" | ||
| 5 | source = { | ||
| 6 | url = "file://../upstream/non_lua_file-1.0.tar.gz" | ||
| 7 | } | ||
| 8 | description = { | ||
| 9 | summary = "An example rockspec that has a script.", | ||
| 10 | } | ||
| 11 | dependencies = { | ||
| 12 | "lua >= 5.1", | ||
| 13 | } | ||
| 14 | build = { | ||
| 15 | type = "builtin", | ||
| 16 | modules = {}, | ||
| 17 | install = { | ||
| 18 | lua = { | ||
| 19 | ["sailor.blank-app.htaccess"] = "src/sailor/blank-app/.htaccess", | ||
| 20 | } | ||
| 21 | } | ||
| 22 | } | ||
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 --- /dev/null +++ b/spec/fixtures/a_repo/non_lua_file-1.0-1.src.rock | |||
| Binary files 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 @@ | |||
| 1 | -- regression test for sailorproject/sailor#138 | ||
| 2 | rockspec_format = "3.0" | ||
| 3 | package = "non_lua_file" | ||
| 4 | version = "1.0-2" | ||
| 5 | source = { | ||
| 6 | url = "file://../upstream/non_lua_file-1.0.tar.gz" | ||
| 7 | } | ||
| 8 | description = { | ||
| 9 | summary = "An example rockspec that has a script.", | ||
| 10 | } | ||
| 11 | dependencies = { | ||
| 12 | "lua >= 5.1", | ||
| 13 | } | ||
| 14 | build = { | ||
| 15 | type = "builtin", | ||
| 16 | modules = {}, | ||
| 17 | install = { | ||
| 18 | lua = { | ||
| 19 | ["sailor.blank-app.htaccess"] = "src/sailor/blank-app/.htaccess", | ||
| 20 | } | ||
| 21 | } | ||
| 22 | } | ||
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 --- /dev/null +++ b/spec/fixtures/a_repo/non_lua_file-1.0-2.src.rock | |||
| Binary files 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 = { | |||
| 22 | "/wsapi-1.6-1.src.rock", | 22 | "/wsapi-1.6-1.src.rock", |
| 23 | "/luafilesystem-1.6.3-2.src.rock", | 23 | "/luafilesystem-1.6.3-2.src.rock", |
| 24 | "/luafilesystem-1.6.3-1.src.rock", | 24 | "/luafilesystem-1.6.3-1.src.rock", |
| 25 | "/sailor-0.5-3.src.rock", | ||
| 26 | "/sailor-0.5-4.src.rock", | ||
| 27 | "spec/fixtures/a_repo/has_build_dep-1.0-1.all.rock", | 25 | "spec/fixtures/a_repo/has_build_dep-1.0-1.all.rock", |
| 28 | "spec/fixtures/a_repo/a_build_dep-1.0-1.all.rock", | 26 | "spec/fixtures/a_repo/a_build_dep-1.0-1.all.rock", |
| 29 | "spec/fixtures/a_repo/a_rock-1.0-1.src.rock", | 27 | "spec/fixtures/a_repo/a_rock-1.0-1.src.rock", |
| 28 | "spec/fixtures/a_repo/non_lua_file-1.0-1.src.rock", | ||
| 29 | "spec/fixtures/a_repo/non_lua_file-1.0-2.src.rock", | ||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | describe("luarocks install #integration", function() | 32 | describe("luarocks install #integration", function() |
| @@ -183,11 +183,11 @@ describe("luarocks install #integration", function() | |||
| 183 | end) | 183 | end) |
| 184 | 184 | ||
| 185 | it('handle non-Lua files in build.install.lua when upgrading sailorproject/sailor#138', function() | 185 | it('handle non-Lua files in build.install.lua when upgrading sailorproject/sailor#138', function() |
| 186 | assert.is_true(run.luarocks_bool("install sailor 0.5-3 --deps-mode=none")) | 186 | assert.is_true(run.luarocks_bool("install non_lua_file 1.0-1 --deps-mode=none")) |
| 187 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess")) | 187 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess")) |
| 188 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess~")) | 188 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess~")) |
| 189 | 189 | ||
| 190 | assert.is_true(run.luarocks_bool("install sailor 0.5-4 --deps-mode=none")) | 190 | assert.is_true(run.luarocks_bool("install non_lua_file 1.0-2 --deps-mode=none")) |
| 191 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess")) | 191 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess")) |
| 192 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess~")) | 192 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/sailor/blank-app/.htaccess~")) |
| 193 | end) | 193 | end) |
| @@ -281,7 +281,7 @@ describe("luarocks install #integration", function() | |||
| 281 | 281 | ||
| 282 | describe("#build_dependencies", function() | 282 | describe("#build_dependencies", function() |
| 283 | it("install does not install a build dependency", function() | 283 | it("install does not install a build dependency", function() |
| 284 | assert(run.luarocks_bool("install has_build_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | 284 | assert(run.luarocks_bool("install has_build_dep")) |
| 285 | assert(run.luarocks_bool("show has_build_dep 1.0")) | 285 | assert(run.luarocks_bool("show has_build_dep 1.0")) |
| 286 | assert.falsy(run.luarocks_bool("show a_build_dep 1.0")) | 286 | assert.falsy(run.luarocks_bool("show a_build_dep 1.0")) |
| 287 | end) | 287 | end) |
