GitHub Need To Know » History » Version 2
rainerkoenig, 2021-09-21 16:41
Added hint for soft_failure test in CI workflow
1 | 1 | rainerkoenig | # GitHub Need To Know |
---|---|---|---|
2 | |||
3 | ## CI tests on pull requests |
||
4 | |||
5 | * GitHub CI is using [perltidy](https://metacpan.org/dist/Perl-Tidy/view/bin/perltidy) to check your changes to Perl modules. |
||
6 | 2 | rainerkoenig | * GitHub CI is doing some more tests on your Perl modules. |
7 | |||
8 | ## Perl-Tidy |
||
9 | |||
10 | 1 | rainerkoenig | * The version used is 20210717, so install it from [software.opensuse.org](https://software.opensuse.org/package/perl-Perl-Tidy?search_term=perl-tidy) if you have another version. |
11 | |||
12 | ### Perl-Tidy configruation file |
||
13 | |||
14 | You need to place a file called `.perltidyrc` in your home directory. The file should contain the following: |
||
15 | |||
16 | ~~~ text |
||
17 | # 120 characters would be desired but it is not feasible right now |
||
18 | #-l=120 # 120 characters per line |
||
19 | -l=160 |
||
20 | -fbl # don't change blank lines |
||
21 | -fnl # don't remove new lines |
||
22 | -nsfs # no spaces before semicolons |
||
23 | -baao # space after operators |
||
24 | -bbao # space before operators |
||
25 | -pt=2 # no spaces around () |
||
26 | -bt=2 # no spaces around [] |
||
27 | -sbt=2 # no spaces around {} |
||
28 | -sct # stack closing tokens )} |
||
29 | |||
30 | ~~~ |
||
31 | |||
32 | These are the same parameters as used by the CI workflow. |
||
33 | |||
34 | ### Beware of the evil tabs |
||
35 | |||
36 | One trouble I had with perltidy after inserting a line of code and indented comment lines was, that it complained |
||
37 | about the whitespace used for indentation. My Emacs used TAB and perltidy wants pure spaces. |
||
38 | |||
39 | To avoid this you can add this setting from the [EmacsWiki](https://www.emacswiki.org/emacs/NoTabs) to your local Emacs config file: |
||
40 | |||
41 | ~~~ lua |
||
42 | (setq-default indent-tabs-mode nil) |
||
43 | ~~~ |
||
44 | 2 | rainerkoenig | |
45 | ## More Perl tests |
||
46 | |||
47 | ### Trap when using record_soft_failure |
||
48 | |||
49 | GitHub CI uses [this test](https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/629ca344f300c96c8bafe434b133bf155f01c6d1/Makefile#L144) test in the Makefile to check if every soft_failure has a reference. References are tested with his regex: |
||
50 | |||
51 | ~~~ python |
||
52 | '([$$0-9a-z]+#[$$0-9a-zA-Z]+|fate.suse.com/[0-9]|\$$[a-z]+)' |
||
53 | ~~~ |
||
54 | |||
55 | There is an unwritten rule that when recording a soft_failure you need to reference a bug. So you should state something like 'bsc#12345' as a reference. |
||
56 | |||
57 | When no reference is set then the GitHub CI workflow will fail. |