foreman_openbolt 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +190 -19
- data/Rakefile +17 -93
- data/app/controllers/foreman_openbolt/task_controller.rb +61 -49
- data/app/lib/actions/foreman_openbolt/cleanup_proxy_artifacts.rb +11 -10
- data/app/lib/actions/foreman_openbolt/poll_task_status.rb +70 -60
- data/app/models/foreman_openbolt/task_job.rb +16 -17
- data/config/routes.rb +0 -1
- data/lib/foreman_openbolt/engine.rb +11 -11
- data/lib/foreman_openbolt/version.rb +1 -1
- data/lib/proxy_api/openbolt.rb +25 -9
- data/lib/tasks/foreman_openbolt_tasks.rake +1 -22
- data/locale/gemspec.rb +1 -1
- data/package.json +11 -15
- data/test/acceptance/acceptance_helper.rb +146 -0
- data/test/acceptance/docker/docker-compose.yml +69 -0
- data/test/acceptance/docker/foreman/Dockerfile +45 -0
- data/test/acceptance/docker/foreman/entrypoint.sh +26 -0
- data/test/acceptance/docker/target/Dockerfile +29 -0
- data/test/acceptance/docker/target/entrypoint.sh +11 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/complex_params.json +30 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/complex_params.sh +16 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/echo.json +13 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/echo.sh +3 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/failing_task.json +8 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/failing_task.sh +3 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/noop_task.json +8 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/noop_task.sh +2 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/slow_task.json +14 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/slow_task.sh +3 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/target_conditional.json +13 -0
- data/test/acceptance/fixtures/modules/acceptance/tasks/target_conditional.sh +9 -0
- data/test/acceptance/fixtures/openbolt.yml +7 -0
- data/test/acceptance/tests/error_handling_test.rb +40 -0
- data/test/acceptance/tests/host_selector_test.rb +31 -0
- data/test/acceptance/tests/launch_task_test.rb +96 -0
- data/test/acceptance/tests/parameter_table_test.rb +61 -0
- data/test/acceptance/tests/settings_test.rb +95 -0
- data/test/acceptance/tests/ssh_options_test.rb +77 -0
- data/test/acceptance/tests/task_execution_test.rb +40 -0
- data/test/acceptance/tests/task_history_test.rb +84 -0
- data/test/acceptance/tests/transport_options_test.rb +121 -0
- data/test/test_plugin_helper.rb +12 -3
- data/test/unit/controllers/task_controller_test.rb +351 -0
- data/test/unit/docker/Dockerfile +47 -0
- data/test/unit/docker/docker-compose.yml +33 -0
- data/test/unit/docker/entrypoint.sh +4 -0
- data/test/unit/factories/foreman_openbolt_factories.rb +39 -0
- data/test/unit/lib/actions/cleanup_proxy_artifacts_test.rb +51 -0
- data/test/unit/lib/actions/poll_task_status_test.rb +141 -0
- data/test/unit/lib/proxy_api/openbolt_test.rb +174 -0
- data/test/unit/models/task_job_test.rb +278 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +15 -0
- data/webpack/__mocks__/foremanReact/components/ToastsList/index.js +6 -0
- data/webpack/__mocks__/foremanReact/redux/API/index.js +11 -0
- data/webpack/src/Components/LaunchTask/FieldTable.js +8 -5
- data/webpack/src/Components/LaunchTask/HostSelector/SearchSelect.js +74 -62
- data/webpack/src/Components/LaunchTask/HostSelector/SelectedChips.js +11 -13
- data/webpack/src/Components/LaunchTask/HostSelector/index.js +28 -33
- data/webpack/src/Components/LaunchTask/OpenBoltOptionsSection.js +3 -2
- data/webpack/src/Components/LaunchTask/ParameterField.js +2 -0
- data/webpack/src/Components/LaunchTask/SmartProxySelect.js +2 -1
- data/webpack/src/Components/LaunchTask/TaskSelect.js +3 -3
- data/webpack/src/Components/LaunchTask/__tests__/EmptyContent.test.js +10 -0
- data/webpack/src/Components/LaunchTask/__tests__/LaunchTask.test.js +83 -0
- data/webpack/src/Components/LaunchTask/__tests__/ParameterField.test.js +86 -0
- data/webpack/src/Components/LaunchTask/__tests__/ParametersSection.test.js +50 -0
- data/webpack/src/Components/LaunchTask/__tests__/SmartProxySelect.test.js +63 -0
- data/webpack/src/Components/LaunchTask/__tests__/TaskSelect.test.js +39 -0
- data/webpack/src/Components/LaunchTask/hooks/__tests__/useOpenBoltOptions.test.js +90 -0
- data/webpack/src/Components/LaunchTask/hooks/__tests__/useSmartProxies.test.js +69 -0
- data/webpack/src/Components/LaunchTask/hooks/__tests__/useTasksData.test.js +103 -0
- data/webpack/src/Components/LaunchTask/hooks/useOpenBoltOptions.js +9 -11
- data/webpack/src/Components/LaunchTask/hooks/useSmartProxies.js +12 -13
- data/webpack/src/Components/LaunchTask/hooks/useTasksData.js +6 -13
- data/webpack/src/Components/LaunchTask/index.js +9 -27
- data/webpack/src/Components/TaskExecution/ExecutionDetails.js +29 -29
- data/webpack/src/Components/TaskExecution/ExecutionDisplay.js +9 -10
- data/webpack/src/Components/TaskExecution/LoadingIndicator.js +7 -2
- data/webpack/src/Components/TaskExecution/ResultDisplay.js +13 -17
- data/webpack/src/Components/TaskExecution/TaskDetails.js +58 -67
- data/webpack/src/Components/TaskExecution/__tests__/ExecutionDetails.test.js +47 -0
- data/webpack/src/Components/TaskExecution/__tests__/ExecutionDisplay.test.js +29 -0
- data/webpack/src/Components/TaskExecution/__tests__/LoadingIndicator.test.js +25 -0
- data/webpack/src/Components/TaskExecution/__tests__/ResultDisplay.test.js +28 -0
- data/webpack/src/Components/TaskExecution/__tests__/TaskDetails.test.js +38 -0
- data/webpack/src/Components/TaskExecution/__tests__/TaskExecution.test.js +80 -0
- data/webpack/src/Components/TaskExecution/hooks/__tests__/useJobPolling.test.js +177 -0
- data/webpack/src/Components/TaskExecution/hooks/useJobPolling.js +34 -33
- data/webpack/src/Components/TaskExecution/index.js +10 -12
- data/webpack/src/Components/TaskHistory/TaskPopover.js +9 -12
- data/webpack/src/Components/TaskHistory/__tests__/TaskHistory.test.js +109 -0
- data/webpack/src/Components/TaskHistory/__tests__/TaskPopover.test.js +26 -0
- data/webpack/src/Components/TaskHistory/index.js +21 -29
- data/webpack/src/Components/common/HostsPopover.js +12 -3
- data/webpack/src/Components/common/__tests__/HostsPopover.test.js +20 -0
- data/webpack/src/Components/common/__tests__/helpers.test.js +135 -0
- data/webpack/src/Components/common/helpers.js +34 -5
- data/webpack/test_setup.js +34 -11
- metadata +65 -87
- data/test/factories/foreman_openbolt_factories.rb +0 -7
- data/test/unit/foreman_openbolt_test.rb +0 -13
- data/webpack/global_test_setup.js +0 -11
- data/webpack/webpack.config.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
|
3
|
+
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
|
|
4
4
|
import { Popover, Button } from '@patternfly/react-core';
|
|
5
5
|
import { Table, Tbody, Tr, Td } from '@patternfly/react-table';
|
|
6
6
|
|
|
@@ -17,7 +17,12 @@ const HostsPopover = ({ targets }) => {
|
|
|
17
17
|
border: '1px solid var(--pf-v5-global--BorderColor--100)',
|
|
18
18
|
}}
|
|
19
19
|
>
|
|
20
|
-
<Table
|
|
20
|
+
<Table
|
|
21
|
+
variant="compact"
|
|
22
|
+
borders
|
|
23
|
+
isStriped
|
|
24
|
+
aria-label={__('Target hosts')}
|
|
25
|
+
>
|
|
21
26
|
<Tbody>
|
|
22
27
|
{targets.map((host, index) => (
|
|
23
28
|
<Tr key={index}>
|
|
@@ -31,7 +36,11 @@ const HostsPopover = ({ targets }) => {
|
|
|
31
36
|
|
|
32
37
|
return (
|
|
33
38
|
<Popover bodyContent={popoverContent} position="right" maxWidth="600px">
|
|
34
|
-
<Button
|
|
39
|
+
<Button
|
|
40
|
+
variant="link"
|
|
41
|
+
isInline
|
|
42
|
+
aria-label={sprintf(__('%s target hosts'), targets.length)}
|
|
43
|
+
>
|
|
35
44
|
{targets.length}
|
|
36
45
|
</Button>
|
|
37
46
|
</Popover>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import HostsPopover from '../HostsPopover';
|
|
4
|
+
|
|
5
|
+
describe('HostsPopover', () => {
|
|
6
|
+
test('shows "No targets specified" when targets is empty', () => {
|
|
7
|
+
render(<HostsPopover targets={[]} />);
|
|
8
|
+
expect(screen.getByText('No targets specified')).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('shows "No targets specified" when targets is not provided', () => {
|
|
12
|
+
render(<HostsPopover />);
|
|
13
|
+
expect(screen.getByText('No targets specified')).toBeInTheDocument();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('shows target count as button when targets exist', () => {
|
|
17
|
+
render(<HostsPopover targets={['host1.com', 'host2.com', 'host3.com']} />);
|
|
18
|
+
expect(screen.getByText('3')).toBeInTheDocument();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
extractErrorMessage,
|
|
3
|
+
displayValue,
|
|
4
|
+
formatDuration,
|
|
5
|
+
formatDate,
|
|
6
|
+
} from '../helpers';
|
|
7
|
+
|
|
8
|
+
describe('extractErrorMessage', () => {
|
|
9
|
+
test('extracts error from response.data.error', () => {
|
|
10
|
+
const error = { response: { data: { error: 'Proxy unreachable' } } };
|
|
11
|
+
expect(extractErrorMessage(error)).toBe('Proxy unreachable');
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('extracts error from response.data.error when error is an object with message', () => {
|
|
15
|
+
const error = { response: { data: { error: { message: 'Bad request' } } } };
|
|
16
|
+
expect(extractErrorMessage(error)).toBe('Bad request');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('stringifies object error without message key', () => {
|
|
20
|
+
const errorObj = { code: 500, detail: 'internal' };
|
|
21
|
+
const error = { response: { data: { error: errorObj } } };
|
|
22
|
+
expect(extractErrorMessage(error)).toBe(JSON.stringify(errorObj));
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('falls back to error.message', () => {
|
|
26
|
+
const error = { message: 'Network error' };
|
|
27
|
+
expect(extractErrorMessage(error)).toBe('Network error');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('returns Unknown error when no useful fields exist', () => {
|
|
31
|
+
const error = {};
|
|
32
|
+
expect(extractErrorMessage(error)).toBe('Unknown error');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('returns Unknown error for null input', () => {
|
|
36
|
+
expect(extractErrorMessage(null)).toBe('Unknown error');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('returns Unknown error for undefined input', () => {
|
|
40
|
+
expect(extractErrorMessage(undefined)).toBe('Unknown error');
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe('displayValue', () => {
|
|
45
|
+
test('returns dash for null', () => {
|
|
46
|
+
expect(displayValue(null)).toBe('-');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('returns dash for undefined', () => {
|
|
50
|
+
expect(displayValue(undefined)).toBe('-');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('returns JSON string for objects', () => {
|
|
54
|
+
expect(displayValue({ key: 'val' })).toBe('{"key":"val"}');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('returns string representation for numbers', () => {
|
|
58
|
+
expect(displayValue(42)).toBe('42');
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('returns string as-is', () => {
|
|
62
|
+
expect(displayValue('hello')).toBe('hello');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('returns string for boolean', () => {
|
|
66
|
+
expect(displayValue(true)).toBe('true');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('returns empty string as-is (not dash)', () => {
|
|
70
|
+
expect(displayValue('')).toBe('');
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe('formatDuration', () => {
|
|
75
|
+
test('returns dash for null', () => {
|
|
76
|
+
expect(formatDuration(null)).toBe('-');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test('returns dash for undefined', () => {
|
|
80
|
+
expect(formatDuration(undefined)).toBe('-');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('returns 0s for zero', () => {
|
|
84
|
+
expect(formatDuration(0)).toBe('0s');
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('returns dash for negative', () => {
|
|
88
|
+
expect(formatDuration(-5)).toBe('-');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test('formats seconds only', () => {
|
|
92
|
+
expect(formatDuration(45)).toBe('45s');
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test('formats minutes and seconds', () => {
|
|
96
|
+
expect(formatDuration(125)).toBe('2m 5s');
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('formats hours, minutes, and seconds', () => {
|
|
100
|
+
expect(formatDuration(3661)).toBe('1h 1m 1s');
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test('formats exact minute boundary', () => {
|
|
104
|
+
expect(formatDuration(60)).toBe('1m 0s');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test('formats exact hour boundary', () => {
|
|
108
|
+
expect(formatDuration(3600)).toBe('1h 0m 0s');
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test('rounds fractional seconds', () => {
|
|
112
|
+
expect(formatDuration(45.7)).toBe('46s');
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
describe('formatDate', () => {
|
|
117
|
+
test('returns dash for null', () => {
|
|
118
|
+
expect(formatDate(null)).toBe('-');
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('returns dash for empty string', () => {
|
|
122
|
+
expect(formatDate('')).toBe('-');
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test('returns dash for invalid date string', () => {
|
|
126
|
+
expect(formatDate('not-a-date')).toBe('-');
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test('formats a valid ISO date with recognizable date components', () => {
|
|
130
|
+
const result = formatDate('2026-01-15T10:30:00Z');
|
|
131
|
+
expect(result).not.toBe('-');
|
|
132
|
+
expect(result).toMatch(/2026/);
|
|
133
|
+
expect(result).toMatch(/15/);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import { useDispatch } from 'react-redux';
|
|
3
3
|
import { addToast } from 'foremanReact/components/ToastsList';
|
|
4
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* Custom hook to show messages using the Foreman Toast system.
|
|
7
|
-
*
|
|
8
|
-
* @returns {Function} A function that takes a message and type, and shows a toast message.
|
|
9
|
-
*/
|
|
10
6
|
export const useShowMessage = () => {
|
|
11
7
|
const dispatch = useDispatch();
|
|
12
8
|
|
|
@@ -17,3 +13,36 @@ export const useShowMessage = () => {
|
|
|
17
13
|
[dispatch]
|
|
18
14
|
);
|
|
19
15
|
};
|
|
16
|
+
|
|
17
|
+
export const extractErrorMessage = error => {
|
|
18
|
+
if (!error) return __('Unknown error');
|
|
19
|
+
const rawError =
|
|
20
|
+
error.response?.data?.error || error.message || __('Unknown error');
|
|
21
|
+
if (typeof rawError === 'object')
|
|
22
|
+
return rawError.message || JSON.stringify(rawError);
|
|
23
|
+
return rawError;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const displayValue = value => {
|
|
27
|
+
if (value === null || value === undefined) return '-';
|
|
28
|
+
if (typeof value === 'object') return JSON.stringify(value);
|
|
29
|
+
return String(value);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const formatDuration = duration => {
|
|
33
|
+
if (duration === null || duration === undefined || duration < 0) return '-';
|
|
34
|
+
const totalSeconds = Math.round(duration);
|
|
35
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
36
|
+
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
37
|
+
const seconds = totalSeconds % 60;
|
|
38
|
+
if (hours > 0) return `${hours}h ${minutes}m ${seconds}s`;
|
|
39
|
+
if (minutes > 0) return `${minutes}m ${seconds}s`;
|
|
40
|
+
return `${seconds}s`;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const formatDate = dateString => {
|
|
44
|
+
if (!dateString) return '-';
|
|
45
|
+
const date = new Date(dateString);
|
|
46
|
+
if (Number.isNaN(date.getTime())) return '-';
|
|
47
|
+
return date.toLocaleString();
|
|
48
|
+
};
|
data/webpack/test_setup.js
CHANGED
|
@@ -1,17 +1,40 @@
|
|
|
1
|
-
import 'core-js/shim';
|
|
2
|
-
import 'regenerator-runtime/runtime';
|
|
3
|
-
import MutationObserver from '@sheerun/mutationobserver-shim';
|
|
4
|
-
|
|
5
|
-
import { configure } from 'enzyme';
|
|
6
|
-
import Adapter from 'enzyme-adapter-react-16';
|
|
7
|
-
|
|
8
|
-
configure({ adapter: new Adapter() });
|
|
9
|
-
|
|
10
1
|
// Mocking translation function
|
|
11
2
|
global.__ = text => text; // eslint-disable-line
|
|
12
3
|
|
|
13
4
|
// Mocking locales to prevent unnecessary fallback messages
|
|
14
5
|
window.locales = { en: { domain: 'app', locale_data: { app: { '': {} } } } };
|
|
15
6
|
|
|
16
|
-
//
|
|
17
|
-
|
|
7
|
+
// Suppress React warnings about unrecognized DOM props from PatternFly 5.
|
|
8
|
+
// PF5 passes custom attributes (ouia*, variant helpers) that React warns
|
|
9
|
+
// about. Only suppress known PF5 prop names so real component bugs still
|
|
10
|
+
// surface as test failures.
|
|
11
|
+
const PF5_KNOWN_PROPS = [
|
|
12
|
+
'ouiaSafe',
|
|
13
|
+
'ouiaId',
|
|
14
|
+
'isExpanded',
|
|
15
|
+
'isDisabled',
|
|
16
|
+
'isActive',
|
|
17
|
+
'isPlain',
|
|
18
|
+
'isInline',
|
|
19
|
+
'isFilled',
|
|
20
|
+
'isCompact',
|
|
21
|
+
'isHovered',
|
|
22
|
+
'isStriped',
|
|
23
|
+
'isStickyHeader',
|
|
24
|
+
'hasRightBorder',
|
|
25
|
+
'hasGutter',
|
|
26
|
+
];
|
|
27
|
+
const originalConsoleError = console.error; // eslint-disable-line no-console
|
|
28
|
+
// eslint-disable-next-line no-console
|
|
29
|
+
console.error = (...args) => {
|
|
30
|
+
const message = typeof args[0] === 'string' ? args[0] : '';
|
|
31
|
+
if (message.includes('does not recognize the `%s` prop')) {
|
|
32
|
+
const propName = typeof args[1] === 'string' ? args[1] : '';
|
|
33
|
+
if (PF5_KNOWN_PROPS.includes(propName)) return;
|
|
34
|
+
}
|
|
35
|
+
originalConsoleError.apply(console, args);
|
|
36
|
+
const errorMsg = args
|
|
37
|
+
.map(arg => (typeof arg === 'string' ? arg : JSON.stringify(arg)))
|
|
38
|
+
.join(' ');
|
|
39
|
+
throw new Error(errorMsg || 'console.error was called');
|
|
40
|
+
};
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_openbolt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Overlook InfraTech
|
|
@@ -29,82 +29,6 @@ dependencies:
|
|
|
29
29
|
- - "<"
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
31
|
version: '13'
|
|
32
|
-
- !ruby/object:Gem::Dependency
|
|
33
|
-
name: erb_lint
|
|
34
|
-
requirement: !ruby/object:Gem::Requirement
|
|
35
|
-
requirements:
|
|
36
|
-
- - "~>"
|
|
37
|
-
- !ruby/object:Gem::Version
|
|
38
|
-
version: 0.9.0
|
|
39
|
-
type: :development
|
|
40
|
-
prerelease: false
|
|
41
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
-
requirements:
|
|
43
|
-
- - "~>"
|
|
44
|
-
- !ruby/object:Gem::Version
|
|
45
|
-
version: 0.9.0
|
|
46
|
-
- !ruby/object:Gem::Dependency
|
|
47
|
-
name: rake
|
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
|
49
|
-
requirements:
|
|
50
|
-
- - "~>"
|
|
51
|
-
- !ruby/object:Gem::Version
|
|
52
|
-
version: '13.0'
|
|
53
|
-
- - ">="
|
|
54
|
-
- !ruby/object:Gem::Version
|
|
55
|
-
version: 13.0.6
|
|
56
|
-
type: :development
|
|
57
|
-
prerelease: false
|
|
58
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
59
|
-
requirements:
|
|
60
|
-
- - "~>"
|
|
61
|
-
- !ruby/object:Gem::Version
|
|
62
|
-
version: '13.0'
|
|
63
|
-
- - ">="
|
|
64
|
-
- !ruby/object:Gem::Version
|
|
65
|
-
version: 13.0.6
|
|
66
|
-
- !ruby/object:Gem::Dependency
|
|
67
|
-
name: rdoc
|
|
68
|
-
requirement: !ruby/object:Gem::Requirement
|
|
69
|
-
requirements:
|
|
70
|
-
- - "~>"
|
|
71
|
-
- !ruby/object:Gem::Version
|
|
72
|
-
version: '6.5'
|
|
73
|
-
type: :development
|
|
74
|
-
prerelease: false
|
|
75
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
76
|
-
requirements:
|
|
77
|
-
- - "~>"
|
|
78
|
-
- !ruby/object:Gem::Version
|
|
79
|
-
version: '6.5'
|
|
80
|
-
- !ruby/object:Gem::Dependency
|
|
81
|
-
name: theforeman-rubocop
|
|
82
|
-
requirement: !ruby/object:Gem::Requirement
|
|
83
|
-
requirements:
|
|
84
|
-
- - "~>"
|
|
85
|
-
- !ruby/object:Gem::Version
|
|
86
|
-
version: 0.1.2
|
|
87
|
-
type: :development
|
|
88
|
-
prerelease: false
|
|
89
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
90
|
-
requirements:
|
|
91
|
-
- - "~>"
|
|
92
|
-
- !ruby/object:Gem::Version
|
|
93
|
-
version: 0.1.2
|
|
94
|
-
- !ruby/object:Gem::Dependency
|
|
95
|
-
name: rubocop-rake
|
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
|
97
|
-
requirements:
|
|
98
|
-
- - "~>"
|
|
99
|
-
- !ruby/object:Gem::Version
|
|
100
|
-
version: 0.6.0
|
|
101
|
-
type: :development
|
|
102
|
-
prerelease: false
|
|
103
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
104
|
-
requirements:
|
|
105
|
-
- - "~>"
|
|
106
|
-
- !ruby/object:Gem::Version
|
|
107
|
-
version: 0.6.0
|
|
108
32
|
description: This plugin adds OpenBolt integration into Foreman, allowing users to
|
|
109
33
|
run tasks and plans present in their environment.
|
|
110
34
|
email:
|
|
@@ -136,11 +60,48 @@ files:
|
|
|
136
60
|
- locale/foreman_openbolt.pot
|
|
137
61
|
- locale/gemspec.rb
|
|
138
62
|
- package.json
|
|
139
|
-
- test/
|
|
63
|
+
- test/acceptance/acceptance_helper.rb
|
|
64
|
+
- test/acceptance/docker/docker-compose.yml
|
|
65
|
+
- test/acceptance/docker/foreman/Dockerfile
|
|
66
|
+
- test/acceptance/docker/foreman/entrypoint.sh
|
|
67
|
+
- test/acceptance/docker/target/Dockerfile
|
|
68
|
+
- test/acceptance/docker/target/entrypoint.sh
|
|
69
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/complex_params.json
|
|
70
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/complex_params.sh
|
|
71
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/echo.json
|
|
72
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/echo.sh
|
|
73
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/failing_task.json
|
|
74
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/failing_task.sh
|
|
75
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/noop_task.json
|
|
76
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/noop_task.sh
|
|
77
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/slow_task.json
|
|
78
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/slow_task.sh
|
|
79
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/target_conditional.json
|
|
80
|
+
- test/acceptance/fixtures/modules/acceptance/tasks/target_conditional.sh
|
|
81
|
+
- test/acceptance/fixtures/openbolt.yml
|
|
82
|
+
- test/acceptance/tests/error_handling_test.rb
|
|
83
|
+
- test/acceptance/tests/host_selector_test.rb
|
|
84
|
+
- test/acceptance/tests/launch_task_test.rb
|
|
85
|
+
- test/acceptance/tests/parameter_table_test.rb
|
|
86
|
+
- test/acceptance/tests/settings_test.rb
|
|
87
|
+
- test/acceptance/tests/ssh_options_test.rb
|
|
88
|
+
- test/acceptance/tests/task_execution_test.rb
|
|
89
|
+
- test/acceptance/tests/task_history_test.rb
|
|
90
|
+
- test/acceptance/tests/transport_options_test.rb
|
|
140
91
|
- test/test_plugin_helper.rb
|
|
141
|
-
- test/unit/
|
|
92
|
+
- test/unit/controllers/task_controller_test.rb
|
|
93
|
+
- test/unit/docker/Dockerfile
|
|
94
|
+
- test/unit/docker/docker-compose.yml
|
|
95
|
+
- test/unit/docker/entrypoint.sh
|
|
96
|
+
- test/unit/factories/foreman_openbolt_factories.rb
|
|
97
|
+
- test/unit/lib/actions/cleanup_proxy_artifacts_test.rb
|
|
98
|
+
- test/unit/lib/actions/poll_task_status_test.rb
|
|
99
|
+
- test/unit/lib/proxy_api/openbolt_test.rb
|
|
100
|
+
- test/unit/models/task_job_test.rb
|
|
101
|
+
- webpack/__mocks__/foremanReact/common/I18n.js
|
|
102
|
+
- webpack/__mocks__/foremanReact/components/ToastsList/index.js
|
|
103
|
+
- webpack/__mocks__/foremanReact/redux/API/index.js
|
|
142
104
|
- webpack/global_index.js
|
|
143
|
-
- webpack/global_test_setup.js
|
|
144
105
|
- webpack/index.js
|
|
145
106
|
- webpack/src/Components/LaunchTask/EmptyContent.js
|
|
146
107
|
- webpack/src/Components/LaunchTask/FieldTable.js
|
|
@@ -155,6 +116,15 @@ files:
|
|
|
155
116
|
- webpack/src/Components/LaunchTask/ParametersSection.js
|
|
156
117
|
- webpack/src/Components/LaunchTask/SmartProxySelect.js
|
|
157
118
|
- webpack/src/Components/LaunchTask/TaskSelect.js
|
|
119
|
+
- webpack/src/Components/LaunchTask/__tests__/EmptyContent.test.js
|
|
120
|
+
- webpack/src/Components/LaunchTask/__tests__/LaunchTask.test.js
|
|
121
|
+
- webpack/src/Components/LaunchTask/__tests__/ParameterField.test.js
|
|
122
|
+
- webpack/src/Components/LaunchTask/__tests__/ParametersSection.test.js
|
|
123
|
+
- webpack/src/Components/LaunchTask/__tests__/SmartProxySelect.test.js
|
|
124
|
+
- webpack/src/Components/LaunchTask/__tests__/TaskSelect.test.js
|
|
125
|
+
- webpack/src/Components/LaunchTask/hooks/__tests__/useOpenBoltOptions.test.js
|
|
126
|
+
- webpack/src/Components/LaunchTask/hooks/__tests__/useSmartProxies.test.js
|
|
127
|
+
- webpack/src/Components/LaunchTask/hooks/__tests__/useTasksData.test.js
|
|
158
128
|
- webpack/src/Components/LaunchTask/hooks/useOpenBoltOptions.js
|
|
159
129
|
- webpack/src/Components/LaunchTask/hooks/useSmartProxies.js
|
|
160
130
|
- webpack/src/Components/LaunchTask/hooks/useTasksData.js
|
|
@@ -164,11 +134,22 @@ files:
|
|
|
164
134
|
- webpack/src/Components/TaskExecution/LoadingIndicator.js
|
|
165
135
|
- webpack/src/Components/TaskExecution/ResultDisplay.js
|
|
166
136
|
- webpack/src/Components/TaskExecution/TaskDetails.js
|
|
137
|
+
- webpack/src/Components/TaskExecution/__tests__/ExecutionDetails.test.js
|
|
138
|
+
- webpack/src/Components/TaskExecution/__tests__/ExecutionDisplay.test.js
|
|
139
|
+
- webpack/src/Components/TaskExecution/__tests__/LoadingIndicator.test.js
|
|
140
|
+
- webpack/src/Components/TaskExecution/__tests__/ResultDisplay.test.js
|
|
141
|
+
- webpack/src/Components/TaskExecution/__tests__/TaskDetails.test.js
|
|
142
|
+
- webpack/src/Components/TaskExecution/__tests__/TaskExecution.test.js
|
|
143
|
+
- webpack/src/Components/TaskExecution/hooks/__tests__/useJobPolling.test.js
|
|
167
144
|
- webpack/src/Components/TaskExecution/hooks/useJobPolling.js
|
|
168
145
|
- webpack/src/Components/TaskExecution/index.js
|
|
169
146
|
- webpack/src/Components/TaskHistory/TaskPopover.js
|
|
147
|
+
- webpack/src/Components/TaskHistory/__tests__/TaskHistory.test.js
|
|
148
|
+
- webpack/src/Components/TaskHistory/__tests__/TaskPopover.test.js
|
|
170
149
|
- webpack/src/Components/TaskHistory/index.js
|
|
171
150
|
- webpack/src/Components/common/HostsPopover.js
|
|
151
|
+
- webpack/src/Components/common/__tests__/HostsPopover.test.js
|
|
152
|
+
- webpack/src/Components/common/__tests__/helpers.test.js
|
|
172
153
|
- webpack/src/Components/common/constants.js
|
|
173
154
|
- webpack/src/Components/common/helpers.js
|
|
174
155
|
- webpack/src/Pages/LaunchTaskPage.js
|
|
@@ -176,12 +157,12 @@ files:
|
|
|
176
157
|
- webpack/src/Pages/TaskHistoryPage.js
|
|
177
158
|
- webpack/src/Router/routes.js
|
|
178
159
|
- webpack/test_setup.js
|
|
179
|
-
- webpack/webpack.config.js
|
|
180
160
|
homepage: https://github.com/overlookinfra/foreman_openbolt
|
|
181
161
|
licenses:
|
|
182
162
|
- GPL-3.0-only
|
|
183
163
|
metadata:
|
|
184
164
|
is_foreman_plugin: 'true'
|
|
165
|
+
rubygems_mfa_required: 'true'
|
|
185
166
|
rdoc_options: []
|
|
186
167
|
require_paths:
|
|
187
168
|
- lib
|
|
@@ -189,7 +170,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
189
170
|
requirements:
|
|
190
171
|
- - ">="
|
|
191
172
|
- !ruby/object:Gem::Version
|
|
192
|
-
version: '
|
|
173
|
+
version: '3.0'
|
|
193
174
|
- - "<"
|
|
194
175
|
- !ruby/object:Gem::Version
|
|
195
176
|
version: '5'
|
|
@@ -199,10 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
199
180
|
- !ruby/object:Gem::Version
|
|
200
181
|
version: '0'
|
|
201
182
|
requirements: []
|
|
202
|
-
rubygems_version: 4.0.
|
|
183
|
+
rubygems_version: 4.0.6
|
|
203
184
|
specification_version: 4
|
|
204
185
|
summary: Foreman OpenBolt integration
|
|
205
|
-
test_files:
|
|
206
|
-
- test/factories/foreman_openbolt_factories.rb
|
|
207
|
-
- test/test_plugin_helper.rb
|
|
208
|
-
- test/unit/foreman_openbolt_test.rb
|
|
186
|
+
test_files: []
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// runs before each test to make sure console.error output will
|
|
2
|
-
// fail a test (i.e. default PropType missing). Check the error
|
|
3
|
-
// output and traceback for actual error.
|
|
4
|
-
global.console.error = (error, stack) => {
|
|
5
|
-
/* eslint-disable-next-line no-console */
|
|
6
|
-
if (stack) console.log(stack); // Prints out original stack trace
|
|
7
|
-
throw new Error(error);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
// Increase jest timeout as some tests using multiple http mocks can time out on CI systems.
|
|
11
|
-
jest.setTimeout(10000);
|