-
Notifications
You must be signed in to change notification settings - Fork 987
110 lines (98 loc) · 3.32 KB
/
mutate-test-sdk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: mutate-test-sdk
on:
pull_request:
branches:
- 'main'
paths:
- '**/JuiceFileSystemTest.java'
workflow_dispatch:
inputs:
targetTests:
type: string
description: "Target tests, eg: io.juicefs.JuiceFileSystemTest"
required: true
default: ""
targetClasses:
type: string
description: "Target classes, eg: io.juicefs.JuiceFileSystemImpl*"
required: true
default: ""
timeoutConstant:
type: int
description: "Timeout constant"
required: true
default: 1000
debug:
type: boolean
description: "Run the build with tmate debugging enabled"
required: false
default: false
jobs:
mutate-test-sdk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
uses: ./.github/actions/build
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
- name: Run Redis
run: |
sudo docker run -d --name redis -v redis-data:/data \
-p 6379:6379 redis redis-server --appendonly yes
- name: Juicefs Format
run: |
sudo ./juicefs format localhost dev
- name: Juicefs Mount
run: |
sudo ./juicefs mount -d localhost /jfs
touch /jfs/inner_sym_target
echo "hello juicefs" > /jfs/inner_sym_target
cd /jfs
ln -s inner_sym_target inner_sym_link
mkdir etc
chmod 777 etc
echo `hostname` > etc/nodes
- name: Make SDK
run: |
cd sdk/java
make
cd -
- name: Change pom
run: |
if [ "${{github.event_name}}" == "pull_request" ]; then
targetTests="io.juicefs.JuiceFileSystemTest"
targetClasses="io.juicefs.JuiceFileSystemImpl*"
timeConstant=1000
elif [ "${{github.event_name}}" == "workflow_dispatch" ]; then
targetTests="${{github.event.inputs.targetTests}}"
echo "targetTests is $targetTests"
targetClasses="${{github.event.inputs.targetClasses}}"
echo "targetClasses is $targetClasses"
timeConstant="${{github.event.inputs.timeConstant}}"
fi
POM_XML_PATH="sdk/java/pom.xml" TARGET_TESTS=$targetTests TARGET_CLASSES=$targetClasses TIME_CONSTANT=$timeConstant python3 .github/scripts/mutate/modify_sdk_pom.py
cat sdk/java/pom.xml
- name: Test SDK
run: |
cd sdk/java
sudo mvn --no-transfer-progress test-compile org.pitest:pitest-maven:mutationCoverage
cd -
- name: Upload Pit Report
uses: actions/upload-artifact@v3
with:
name: pit-reports
path: sdk/java/target/pit-reports
- name: Send Slack Notification
if: failure() && github.event_name != 'workflow_dispatch'
uses: juicedata/slack-notify-action@main
with:
channel-id: "${{ secrets.SLACK_CHANNEL_ID_FOR_PR_CHECK_NOTIFY }}"
slack_bot_token: "${{ secrets.SLACK_BOT_TOKEN }}"
- name: Setup upterm session
if: failure() && (github.event.inputs.debug == 'true' || github.run_attempt != 1)
timeout-minutes: 60
uses: lhotari/action-upterm@v1