Skip to content

Commit

Permalink
Merge pull request #14 from ATIX-AG/fix_tests
Browse files Browse the repository at this point in the history
Fix github actions
  • Loading branch information
sbernhard authored Dec 22, 2023
2 parents 277d911 + 453b9c9 commit 1c1d932
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 115 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/javascript_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: React and Javascript tests
on:
pull_request:
push:
branches:
- master

jobs:
test_js:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [14]
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm install
- name: Linting
run: |
# FIXME: we need to fix the findings, first
#npm run lint
npm run stylelint
- name: Testing
run: npm run test
...
5 changes: 1 addition & 4 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
with:
ruby-version: 2.7
bundler-cache: true
- name: Setup rubocop
run: |
gem install bundler
- name: Execute rubocop
run: |
bundle exec rubocop
bundle exec rake rubocop
43 changes: 9 additions & 34 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ jobs:
fail-fast: false
matrix:
foreman-repo: [theforeman/foreman]
foreman-core-branch: [3.3-stable, 3.4-stable, develop]
foreman-core-branch: [3.8-stable, 3.9-stable, develop]
ruby-version: [2.7]
node: [14]
steps:
- run: |
sudo apt-get update
Expand All @@ -38,55 +37,31 @@ jobs:
- uses: actions/checkout@v2
with:
path: foreman_acd
- name: Setup Bundler
- name: Add ACD to foreman
run: |
echo "gem 'foreman_acd', path: './foreman_acd'" > bundler.d/foreman_acd.local.rb
- name: Limit REX and tasks version for Foreman 3.3-stable
- name: Limit REX and tasks version for Foreman 3.8-stable
working-directory: foreman_acd
if: ${{ matrix.foreman-core-branch == '3.3-stable' }}
if: ${{ matrix.foreman-core-branch == '3.8-stable' }}
run: |
sed -i '23,24d' foreman_acd.gemspec
sed -i '23is.add_dependency "foreman-tasks", "~> 6.0"' foreman_acd.gemspec
sed -i '23is.add_dependency "foreman_remote_execution", "~> 7.2"' foreman_acd.gemspec
- name: Limit REX and tasks version for Foreman 3.4-stable
working-directory: foreman_acd
if: ${{ matrix.foreman-core-branch == '3.4-stable' }}
run: |
sed -i '23,24d' foreman_acd.gemspec
sed -i '23is.add_dependency "foreman-tasks", "~> 7.0"' foreman_acd.gemspec
sed -i '23is.add_dependency "foreman_remote_execution", "~> 8.0"' foreman_acd.gemspec
- name: Limit REX and tasks version for Foreman develop
working-directory: foreman_acd
if: ${{ matrix.foreman-core-branch == 'develop' }}
run: |
sed -i '23,24d' foreman_acd.gemspec
sed -i '23is.add_dependency "foreman-tasks", "~> 7.0"' foreman_acd.gemspec
sed -i '23is.add_dependency "foreman_remote_execution", "~> 9.0"' foreman_acd.gemspec
sed -i '/s\.add_dependency .foreman-tasks./s/,[^,]*$/, "~> 8.3"/' foreman_acd.gemspec
sed -i '/s\.add_dependency .foreman_remote_execution./s/,[^,]*$/, "~> 11.1"/' foreman_acd.gemspec
cat foreman_acd.gemspec
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: bundle list
- name: Prepare test env
run: |
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:test:prepare
- name: Prepare webpack
run: |
npm install
bundle exec rake webpack:compile
- name: Run plugin tests
run: |
bundle exec rake test:foreman_acd
- name: Run npm tests
working-directory: ./foreman_acd
run: |
npm test
- name: Run access permission test
run: |
bundle exec rake test TEST="test/unit/foreman/access_permissions_test.rb"
Expand Down
2 changes: 1 addition & 1 deletion .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
trigger: pull_request
targets:
centos-stream-8:
additional_modules: "foreman:el8,nodejs:12"
additional_modules: "foreman:el8,nodejs:14"
additional_repos:
- http://koji.katello.org/releases/yum/foreman-nightly/el8/x86_64/
- http://yum.theforeman.org/plugins/nightly/el8/x86_64/
Expand Down
5 changes: 5 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"stylelint-config-standard",
],
}
36 changes: 36 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
verbose: true,
testMatch: ['**/*.test.js'],
testPathIgnorePatterns: [
'.local',
'.bundle',
'/node_modules/',
'<rootDir>/foreman/',
],
moduleDirectories: ['node_modules', 'webpack'],
testURL: 'http://localhost/',
collectCoverage: true,
collectCoverageFrom: [
'webpack/**/*.js',
'!webpack/index.js',
'!webpack/test_setup.js',
'!webpack/**/bundle*',
'!webpack/stories/**',
'!webpack/**/*stories.js',
],
coverageReporters: ['text', 'lcov'],
moduleNameMapper: {
'^.+\\.(png|gif|css|scss)$': 'identity-obj-proxy',
},
globals: {
__testing__: true,
},
transform: {
'^.+\\.js$': 'babel-jest',
},
setupFiles: [
'raf/polyfill',
'jest-prop-type-error',
'./webpack/test_setup.js',
],
};
62 changes: 12 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"version": "0.9.3",
"description": "foreman application centric deployment",
"main": "index.js",
"directories": {
"test": "test"
},
"peerDependencies": {
"@theforeman/vendor": ">= 10.1.0"
},
Expand All @@ -17,67 +14,32 @@
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"eslint": "^6.7.2",
"jest": "^23.6.0",
"jest-prop-type-error": "^1.1.0",
"lodash": "^4.17.11",
"prettier": "^1.19.1",
"react-redux-test-utils": "^0.1.1",
"sortabular": "^1.5.1",
"stylelint": "^9.3.0",
"stylelint-config-standard": "^18.0.0",
"table-resolver": "^3.2.0"
},
"scripts": {
"test": "node node_modules/.bin/jest --no-cache"
"lint": "tfm-lint --plugin -d *.js,webpack",
"lint-fix": "tfm-lint --plugin -d *.js,webpack --fix",
"stylelint": "stylelint webpack/**/*.scss",
"stylelint-fix": "stylelint webpack/**/*.scss --fix",
"test": "jest --no-cache"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ATIX-AG/foreman_acd.git"
},
"author": "",
"author": "ATIX AG <[email protected]>",
"license": "ISC",
"bugs": {
"url": "https://atix.de"
"url": "https://github.com/ATIX-AG/foreman_acd/issues"
},
"homepage": "https://atix.de",
"jest": {
"verbose": true,
"testMatch": [
"**/*.test.js"
],
"testPathIgnorePatterns": [
".local",
".bundle",
"/node_modules/",
"<rootDir>/foreman/"
],
"moduleDirectories": [
"node_modules",
"webpack"
],
"testURL": "http://localhost/",
"collectCoverage": true,
"collectCoverageFrom": [
"webpack/**/*.js",
"!webpack/index.js",
"!webpack/test_setup.js",
"!webpack/**/bundle*",
"!webpack/stories/**",
"!webpack/**/*stories.js"
],
"coverageReporters": [
"lcov"
],
"moduleNameMapper": {
"^.+\\.(png|gif|css|scss)$": "identity-obj-proxy"
},
"globals": {
"__testing__": true
},
"transform": {
"^.+\\.js$": "babel-jest"
},
"setupFiles": [
"raf/polyfill",
"jest-prop-type-error",
"./webpack/test_setup.js"
]
}
"homepage": "https://atix.de"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
}

.deploy_status_head {
float:left;
width:25%;
height:10%;
float: left;
width: 25%;
height: 10%;
}

.deploy_status_content {
float:left;
width:75%;
height:10%;
float: left;
width: 75%;
height: 10%;
}

.deploy_report_hosts {
float:left;
width:25%;
height:100%;
float: left;
width: 25%;
height: 100%;
}

.deploy_report_tasks {
float:left;
width:75%;
float: left;
width: 75%;
min-height: 300px;
background-color: #ecf9fe;
padding: 10px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@import '~@theforeman/vendor/scss/variables';

.add_existing_hosts_modal {
margin-top: 0;
margin-bottom: 0;
height: 100%;
width: 80%;
max-width: none !important;
margin-top: 0;
margin-bottom: 0;
height: 100%;
width: 80%;
max-width: none !important;
}

.row {
Expand Down
20 changes: 10 additions & 10 deletions webpack/components/ParameterSelection/ParameterSelection.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
@import '~@theforeman/vendor/scss/variables';

.param_selection_modal {
margin-top: 0;
margin-bottom: 0;
height: 100%;
width: 80%;
max-width: none !important;
margin-top: 0;
margin-bottom: 0;
height: 100%;
width: 80%;
max-width: none !important;
}

.complex_data_modal {
margin-top: 0;
margin-bottom: 0;
height: 80%;
width: 40%;
max-width: none !important;
margin-top: 0;
margin-bottom: 0;
height: 80%;
width: 40%;
max-width: none !important;
}

0 comments on commit 1c1d932

Please sign in to comment.