Projet

Général

Profil

Révision 758c3ecd

ID758c3ecdd7c6a709af449e2fc78571e28c7fe508
Parent 809639ab
Enfant 3143c2c5

Ajouté par Lars Kruse il y a plus de 5 ans

Tests: add ruby style and code checks via rubocop

At the moment all plugins fail the test out of various reasons.
Thus they are exempted from causing test failures.

But future (new) plugins will fail the test and thus indicate the
relevant steps to fix issues before a plugin is included.

Voir les différences:

.travis.yml
16 16
      - zsh
17 17
      - pylint
18 18
      - shellcheck
19
      - rubocop
19 20
      - pkg-config
20 21
      - libdb-dev
21 22
      - libvirt-dev
t/test-exception-wrapper.expected-failures
30 30
plugins/bsd/df_abs_bsd
31 31
plugins/bsd/df_bsd
32 32
plugins/bsd/freebsd_hdd_power_state
33
plugins/bsd/netstat_bsd_m_
33 34
plugins/bsd/spamd-blacklist-bsd
34 35
plugins/bsd/spamd-tarpit-bsd
35 36
plugins/cacti/cacti-host
......
90 91
plugins/dvb/2wcomdsr_
91 92
plugins/dvb/femon
92 93
plugins/ejabberd/ejabberd_resources_
94
plugins/ejabberd/ejabberd_scanlog
93 95
plugins/emc/emc_vnx_block_lun_perfdata
94 96
plugins/emc/emc_vnx_file_
95 97
plugins/fan/dell_fans
......
148 150
plugins/horde/horde
149 151
plugins/http/http_pagespeed
150 152
plugins/http/http_responsecode
153
plugins/http/mongrel_memory
154
plugins/http/mongrel_process_memory
151 155
plugins/http/vhost_requests_
152 156
plugins/http/wget_page
153 157
plugins/i2p/i2p_
154 158
plugins/icecast/icecast_
155 159
plugins/icecast/icecast2
160
plugins/icecast/icecast2_simple
156 161
plugins/icecast/icecast2_stats_
157 162
plugins/imapproxy/imapproxy_multi
158 163
plugins/ip6/ip6_
......
187 192
plugins/memory/multimemory
188 193
plugins/memory/proc_mem
189 194
plugins/memory/proc_memory_status
195
plugins/minecraft/minecraft-users
190 196
plugins/mixminion/mixminion
197
plugins/moblock/moblock_connections
191 198
plugins/mod_jk/mod_jk
192 199
plugins/moinmoin/moinoin_pages
193 200
plugins/mongodb/mongo_btree
......
197 204
plugins/mongodb/mongo_lock
198 205
plugins/mongodb/mongo_mem
199 206
plugins/mongodb/mongo_ops
207
plugins/mssql/microsoft-sql
208
plugins/mssql/microsoft-sql-buffer-cache-hit-ratio
209
plugins/mssql/microsoft-sql-data-file-sizes
210
plugins/mssql/microsoft-sql-log-file-size
200 211
plugins/mumble/mumble_users
201 212
plugins/mumble/murmur-stats
202 213
plugins/munin/healthcheck_log
......
220 231
plugins/network/hfsc
221 232
plugins/network/hfsc_sep
222 233
plugins/network/host_traffic
234
plugins/network/http__tp_link
223 235
plugins/network/if1sec_
224 236
plugins/network/ifem_
225 237
plugins/network/if_uptime
......
235 247
plugins/network/netatalk
236 248
plugins/network/netatalk3
237 249
plugins/network/net_hosts_
250
plugins/network/netstat_s_
238 251
plugins/network/nsd3
239 252
plugins/network/olsrd
240 253
plugins/network/packetloss
......
270 283
plugins/openntpd/openntp_offset
271 284
plugins/openvz/openvz_
272 285
plugins/oracle/oracle_connections
286
plugins/oracle/oracle-pga-monitor
287
plugins/oracle/oracle-sga
273 288
plugins/oracle/oracle_sysstat
274 289
plugins/ossec/ossec_active_response
275 290
plugins/ossec/ossec_agents
276 291
plugins/ossec/ossec_alerts
277 292
plugins/other/beanstalkd
278 293
plugins/other/cm2
294
plugins/other/delayed_jobs_queue_size
279 295
plugins/other/earthquakes-stronger-than-m4-and-m5-plus-solar-act
280 296
plugins/other/foldingathome_activecpu
281 297
plugins/other/globesurfer
282 298
plugins/other/hookbox
283 299
plugins/other/listeners
284 300
plugins/other/pid
301
plugins/other/port_
285 302
plugins/other/s9y
286 303
plugins/other/services
304
plugins/passenger/passenger_memory
305
plugins/passenger/passenger_processes
306
plugins/passenger/passenger_status
287 307
plugins/pdns/pdns_errors
288 308
plugins/pdns/pdns_queries
289 309
plugins/pdns/pdns_rec_qtypes
......
298 318
plugins/php/php5-fpm_status
299 319
plugins/php/php_apc_
300 320
plugins/php/php-cgi
321
plugins/php/php_eaccelerator
301 322
plugins/php/php_errors_
302 323
plugins/php/php_opcache
303 324
plugins/php/php_sessions
......
354 375
plugins/printer/xerox-wc3220
355 376
plugins/printer/xerox-wc7232-consumables
356 377
plugins/puma/puma_
378
plugins/puppet/puppet_runtime
357 379
plugins/qmail/qmailconn
358 380
plugins/qmail/queuestats
359 381
plugins/qmail/spamdyke
......
373 395
plugins/riak/riak_fsm_time_95
374 396
plugins/riak/riak_memory
375 397
plugins/riak/riak_node
398
plugins/router/ag241-adsl
376 399
plugins/router/arris-tm502g_
377 400
plugins/router/bbox
378 401
plugins/router/cisco-epc3010_
379 402
plugins/router/conexant_adsl
380 403
plugins/router/dartybox
404
plugins/router/d-link-dir-655-router-statistics-plugin
381 405
plugins/router/dsl-connection-speed
382 406
plugins/router/dsl-stats
383 407
plugins/router/freeboxuptime
384 408
plugins/router/motorola_sb6141
385 409
plugins/router/snmp__juniper
386 410
plugins/router/snmp__juniper_spu
411
plugins/router/snmp__linksys_poe
387 412
plugins/router/speedport_300
388 413
plugins/rsync/rsyncd_bytes
389 414
plugins/rsync/rsyncd_count
......
405 430
plugins/snmp/snmp___bri_se_
406 431
plugins/snmp/snmp__brocade_ifs
407 432
plugins/snmp/snmp__fn
433
plugins/snmp/snmp_room_alert_
408 434
plugins/snmp/snmp__webthermometer
409 435
plugins/solaris/io_disk
410 436
plugins/solaris/zones_cpu
......
414 440
plugins/squid/squid_efficiency
415 441
plugins/squid/squid_times
416 442
plugins/ssh/openssh-denyhosts
443
plugins/ssh/sshd_invalid_countries_ruby
417 444
plugins/ssh/sshd_log
418 445
plugins/streaming/packetship_
419 446
plugins/swift/swift-async_
......
426 453
plugins/tarsnap/tarsnap
427 454
plugins/tcp/tcp-retransmissions
428 455
plugins/tcp/tcp-states
456
plugins/thin/thin_memory
457
plugins/thin/thins_peak_memory
458
plugins/thin/thin_threads
429 459
plugins/tinydns/tinydns
430 460
plugins/tinydns/tinydns_err
431 461
plugins/tor/tor_traffic
......
433 463
plugins/tv/hdhomerun_
434 464
plugins/twemproxy/nutcracker_requests_
435 465
plugins/unicorn/unicorn_
466
plugins/unicorn/unicorn_memory_status
467
plugins/unicorn/unicorn_status
436 468
plugins/user/membyuser
437 469
plugins/user/multipsu
438 470
plugins/user/system_users
......
442 474
plugins/vmware/esxi
443 475
plugins/vmware/esxi__sensors
444 476
plugins/vmware/vm_cpu_load
477
plugins/voldemort/voldemort
445 478
plugins/vpn/openvpn_as_mtime
446 479
plugins/vpn/openvpn_as_traffic
447 480
plugins/vpn/openvpn_as_ttime
t/test.t
192 192
        );
193 193
    }
194 194
    elsif ( $interpreter =~ m{j?ruby} ) {
195
        run_check(
196
            {   command     => [ 'ruby', '-cw', $file ],
197
                description => 'ruby syntax check',
198
                filename    => $filename
199
            }
200
        );
195
        subtest $filename => sub {
196
            plan tests => 2;
197
            run_check(
198
                {   command     => [ 'ruby', '-cw', $file ],
199
                    description => 'ruby syntax check',
200
                    filename    => $filename
201
                }
202
            );
203
            run_check(
204
                {   command     => [ 'rubocop', $file ],
205
                    description => 'ruby style and syntax check',
206
                    filename    => $filename
207
                }
208
            );
209
        }
201 210
    }
202 211
    elsif ( $interpreter =~ m{gawk} ) {
203 212
        run_check(

Formats disponibles : Unified diff