|
| 1 | +[filters.liquibase] |
| 2 | +description = "Compact liquibase output — strip headers and generic info" |
| 3 | +match_command = "(?:^|/)liquibase(?:\\s|$)" |
| 4 | +strip_ansi = true |
| 5 | +filter_stderr = true |
| 6 | +strip_lines_matching = [ |
| 7 | + "^\\s*$", |
| 8 | + "^Starting Liquibase at", |
| 9 | + "^Liquibase (?:Community|Open Source)", |
| 10 | + "^Liquibase Home:", |
| 11 | + "^Java Home", |
| 12 | + "^Libraries:", |
| 13 | + "^\\s*-\\s+\\S+\\.jar", |
| 14 | + "^INFO \\[liquibase\\.integration\\]", |
| 15 | + "^INFO \\[liquibase\\.core\\] Reading resource", |
| 16 | + "^INFO \\[liquibase\\.core\\] Parsing", |
| 17 | + "^(?:\\[?INFO\\]?\\s*)?#+$", |
| 18 | + "^\\s*##" |
| 19 | +] |
| 20 | +on_empty = "liquibase: ok" |
| 21 | +max_lines = 200 |
| 22 | + |
| 23 | +[[tests.liquibase]] |
| 24 | +name = "strip ascii banner and info logs from subcommand" |
| 25 | +input = ''' |
| 26 | +#################################################### |
| 27 | +## _ _ _ _ ## |
| 28 | +## | | (_) (_) | ## |
| 29 | +#################################################### |
| 30 | +Starting Liquibase at 10:12:11 (version 4.29.1) |
| 31 | +Liquibase Version: 4.29.1 |
| 32 | +Liquibase Open Source 4.29.1 by Liquibase |
| 33 | +INFO [liquibase.integration] Starting command |
| 34 | +INFO [liquibase.core] Reading resource db/changelog.xml |
| 35 | +INFO [liquibase.core] Parsing db/changelog.xml |
| 36 | +Running Changeset: filepath::id::author |
| 37 | +Changeset filepath::id::author ran successfully |
| 38 | +''' |
| 39 | +expected = ''' |
| 40 | +Liquibase Version: 4.29.1 |
| 41 | +Running Changeset: filepath::id::author |
| 42 | +Changeset filepath::id::author ran successfully''' |
| 43 | + |
| 44 | +[[tests.liquibase]] |
| 45 | +name = "strip --version noise, keep only version line" |
| 46 | +input = ''' |
| 47 | +#################################################### |
| 48 | +## _ _ _ _ ## |
| 49 | +#################################################### |
| 50 | +Starting Liquibase at 13:45:24 using Java 17.0.15 (version 4.30.0 #4943 built at 2024-10-31 17:00+0000) |
| 51 | +Liquibase Home: D:\mcp\bash\lbr\third-party |
| 52 | +Java Home C:\Program Files\Java\jdk-17.0.15 (Version 17.0.15) |
| 53 | +Libraries: |
| 54 | + - internal\lib\commons-io.jar: Apache Commons IO 2.17.0 By The Apache Software Foundation |
| 55 | + - internal\lib\picocli.jar: picocli 4.7.6 By Remko Popma |
| 56 | + - lib\ojdbc10-19.30.0.0.jar: JDBC 19.30.0.0.0 By Oracle Corporation |
| 57 | +
|
| 58 | +Liquibase Version: 4.30.0 |
| 59 | +Liquibase Open Source 4.30.0 by Liquibase |
| 60 | +''' |
| 61 | +expected = ''' |
| 62 | +Liquibase Version: 4.30.0''' |
| 63 | + |
| 64 | +[[tests.liquibase]] |
| 65 | +name = "keep status and error lines" |
| 66 | +input = ''' |
| 67 | +#################################################### |
| 68 | +## _ _ _ _ ## |
| 69 | +#################################################### |
| 70 | +Starting Liquibase at 10:00:00 (version 4.30.0) |
| 71 | +Liquibase Version: 4.30.0 |
| 72 | +Liquibase Open Source 4.30.0 by Liquibase |
| 73 | +HR@jdbc:oracle:thin:@localhost:1523:XE is up to date |
| 74 | +Liquibase command 'status' was executed successfully. |
| 75 | +''' |
| 76 | +expected = ''' |
| 77 | +Liquibase Version: 4.30.0 |
| 78 | +HR@jdbc:oracle:thin:@localhost:1523:XE is up to date |
| 79 | +Liquibase command 'status' was executed successfully.''' |
| 80 | + |
| 81 | +[[tests.liquibase]] |
| 82 | +name = "empty input" |
| 83 | +input = "" |
| 84 | +expected = "liquibase: ok" |
0 commit comments