diff --git a/.github/workflows/Unit-Test.yml b/.github/workflows/Unit-Test.yml index df6de25dc..0271615a7 100644 --- a/.github/workflows/Unit-Test.yml +++ b/.github/workflows/Unit-Test.yml @@ -20,9 +20,8 @@ jobs: yes | crew upgrade && \ yes | crew install vim && \ yes | crew remove vim && \ - cd ../tests && \ - ./prop_test && \ - ruby commands/* && \ + ruby ../tests/prop_test && \ + ruby ../tests/commands/* && \ cd ~ && \ git clone --depth=1 https://github.com/chromebrew/chromebrew.git build_test && \ cd build_test && \ diff --git a/tests/README.md b/tests/README.md index 3eb2823ed..898150d91 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,4 +1,3 @@ # Tests These are a collection of programs used to ensure crew is working correctly. -They **must** be run in this directory, otherwise they will result in false positives. diff --git a/tests/cycle_test b/tests/cycle_test index 8f662c15e..4adc90563 100755 --- a/tests/cycle_test +++ b/tests/cycle_test @@ -2,14 +2,14 @@ # This test checks whether the packages create a dependency cycle. -# Add >LOCAL< lib to LOAD_PATH -$LOAD_PATH.unshift '../lib' - require 'find' require_relative '../lib/const' require_relative '../lib/color' require_relative '../lib/package' +# Add >LOCAL< lib to LOAD_PATH so that packages can be loaded +$LOAD_PATH.unshift File.join(CREW_LIB_PATH, 'lib') + @all_pkgs = {} puts "Running dependency cycle tests...\n".yellow diff --git a/tests/prop_test b/tests/prop_test index 17c07497d..64ea8e2aa 100755 --- a/tests/prop_test +++ b/tests/prop_test @@ -1,13 +1,12 @@ #!/usr/bin/env ruby -# Add >LOCAL< lib to LOAD_PATH so that packages can be loaded -$LOAD_PATH.unshift '../lib' - -require 'fileutils' require_relative '../lib/const' require_relative '../lib/color' require_relative '../lib/package' +# Add >LOCAL< lib to LOAD_PATH so that packages can be loaded +$LOAD_PATH.unshift File.join(CREW_LIB_PATH, 'lib') + tofail = 0 Dir.glob('../packages/*.rb').each do |filename|