Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-with-foreman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x
- name: Checkout foreman-js
uses: actions/checkout@v2
with:
Expand All @@ -25,7 +25,7 @@ jobs:
repository: theforeman/foreman
path: ./projects/foreman
- name: Install foreman-js npm dependencies
run: npm install
run: npm install --legacy-peer-deps
working-directory: ${{ github.workspace }}/projects/foreman-js
- name: Install foreman npm dependencies
run: npm install
Expand Down
38 changes: 27 additions & 11 deletions .github/workflows/test-with-plugins.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Test foreman plugins with foreman-js
on: [push, pull_request, workflow_dispatch]

env:
BUNDLE_WITHOUT: "console:development:journald:libvirt"


jobs:
test-plugins:
runs-on: ubuntu-latest
Expand All @@ -11,17 +15,16 @@ jobs:
- repo: katello
org: Katello
use-foreman: true
ruby: 2.7
- repo: foreman-tasks
org: theforeman
use-foreman: false
use-foreman: true
ruby: 2.7
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x
- name: Checkout foreman-js
uses: actions/checkout@v2
with:
Expand All @@ -39,16 +42,29 @@ jobs:
repository: ${{ matrix.org }}/${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: ./projects/${{ matrix.repo }}
- name: Set up plugin in Foreman
run: |
echo "gemspec name: '${{ matrix.repo }}', path: '${{ github.workspace }}/projects/${{ matrix.repo }}'" > "bundler.d/${{ matrix.repo }}.local.rb"
if [ -d ${{ matrix.repo }}/gemfile.d ] ; then
cat ${{ matrix.repo }}/gemfile.d/*.rb >> bundler.d/${{ matrix.repo }}.local.rb
fi
working-directory: ${{ github.workspace }}/projects/foreman
- name: "Set up Ruby ${{ matrix.ruby }}"
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
working-directory: ${{ github.workspace }}/projects/foreman
- name: Install foreman-js npm dependencies
run: npm install
run: npm install --legacy-peer-deps
working-directory: ${{ github.workspace }}/projects/foreman-js
- name: Install foreman npm dependencies
if: ${{ matrix.use-foreman }}
run: npm install
working-directory: ${{ github.workspace }}/projects/foreman
- name: Install ${{ matrix.repo }} npm dependencies
if: ${{ matrix.repo != 'foreman' }}
run: npm install
run: npm install --legacy-peer-deps
working-directory: ${{ github.workspace }}/projects/${{ matrix.repo }}
- name: Link foreman-js to foreman
if: ${{ matrix.use-foreman }}
Expand All @@ -58,8 +74,8 @@ jobs:
run: npm run link -- --location '${{ github.workspace }}/projects/${{ matrix.repo }}'
working-directory: ${{ github.workspace }}/projects/foreman-js
- name: Run ${{ matrix.repo }} tests
run: npm test
working-directory: ${{ github.workspace }}/projects/${{ matrix.repo }}
run: npm run test:plugins ${{ matrix.repo }}
working-directory: ${{ github.workspace }}/projects/foreman
- name: Run ${{ matrix.repo }} lint
run: npm run lint
working-directory: ${{ github.workspace }}/projects/${{ matrix.repo }}
run: npm run lint:plugins ${{ matrix.repo }}
working-directory: ${{ github.workspace }}/projects/foreman
4 changes: 4 additions & 0 deletions packages/test/bin/tfm-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ const errorHandling = (error) => {
};

runScript(getJestBin(), errorHandling, jestArgs);

throw new Error(
'@theforeman/test package has been deprecated and will not be maintained. If you wish to continue using this packages use v15 or lower. For more information and alternatives, please refer to: https://community.theforeman.org/t/testing-plugins-from-foreman-core/43293 .'
);
Loading