From 41df33b659ebd99f63a2d9b7f656ad2cdf7b9057 Mon Sep 17 00:00:00 2001 From: MariaAga Date: Tue, 16 Jul 2024 17:57:34 +0100 Subject: [PATCH] debugging --- .github/workflows/plugins_react_tests.yml | 9 +++++++++ script/npm_test_plugin.js | 3 ++- script/plugin_webpack_directories.js | 12 ++++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/plugins_react_tests.yml b/.github/workflows/plugins_react_tests.yml index 62175e09a76..746e87a27c1 100644 --- a/.github/workflows/plugins_react_tests.yml +++ b/.github/workflows/plugins_react_tests.yml @@ -65,6 +65,15 @@ jobs: with: repository: ${{ matrix.plugin }} path: ${{ github.workspace }}/projects/plugin + - name: store plugin name + run: echo "PLUGIN_NAME=$(echo ${{ matrix.plugin }} | awk -F'/' '{print $NF}')" >> "${GITHUB_ENV}" + - name: Set up plugin in Foreman + run: | + echo "gemspec name: $PLUGIN_NAME, path: '/projects/plugin'" > "bundler.d/$PLUGIN_NAME.local.rb" + if [ -d $PLUGIN_NAME/gemfile.d ] ; then + cat $PLUGIN_NAME/gemfile.d/*.rb >> bundler.d/$PLUGIN_NAME.local.rb + fi + working-directory: ${{ github.workspace }}/projects/foreman - name: Generate ${{ matrix.plugin }} npm dependencies package-lock run: npm install --package-lock-only --no-audit --legacy-peer-deps working-directory: ${{ github.workspace }}/projects/plugin diff --git a/script/npm_test_plugin.js b/script/npm_test_plugin.js index e9c9a58cbcf..90eafc4afff 100755 --- a/script/npm_test_plugin.js +++ b/script/npm_test_plugin.js @@ -52,6 +52,7 @@ function runChildProcess(args, pluginPath) { } const runTests = async () => { var dirs = packageJsonDirs(); + console.log('dirs', dirs); function pluginDefinesLint(pluginPath) { var packageHasNodeModules = fs.existsSync(`${pluginPath}/node_modules`); // skip gems var packageData = JSON.parse(fs.readFileSync(`${pluginPath}/package.json`)); @@ -125,7 +126,7 @@ const runTests = async () => { '--color', ...passedArgs, ]; - + console.log('args', args); // eslint-disable-next-line no-await-in-loop await runChildProcess(args, pluginPath); // Run every plugin test in a separate process if (fs.existsSync(combinedConfigPath)) { diff --git a/script/plugin_webpack_directories.js b/script/plugin_webpack_directories.js index 08d006e9c10..33e9a60181e 100644 --- a/script/plugin_webpack_directories.js +++ b/script/plugin_webpack_directories.js @@ -47,8 +47,16 @@ var webpackedDirs = stderr => { }); }; -var getPluginDirs = stderr => - JSON.parse(sanitizeWebpackDirs(webpackedDirs(stderr))); +var getPluginDirs = stderr => { + console.log('stderr', stderr); + // console.log('webpackedDirs', webpackedDirs(stderr)); + // console.log( + // 'sanitizeWebpackDirs', + // // sanitizeWebpackDirs(webpackedDirs(stderr)) + // JSON.parse(sanitizeWebpackDirs(webpackedDirs(stderr))) + // ); + return JSON.parse(sanitizeWebpackDirs(webpackedDirs(stderr))); +}; var packageJsonDirs = stderr => pluginPath('package.json')(getPluginDirs(stderr)).map(path.dirname);