-
Notifications
You must be signed in to change notification settings - Fork 4
107 lines (99 loc) · 3.87 KB
/
end2end.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
name: Test NPMFilter End to End on a Project
on:
workflow_dispatch:
inputs:
project_url:
description: 'GitHub suffix of project to test (username/project)'
required: true
type: string
project_sha:
description: 'SHA of project to test'
required: true
type: string
workflow_call:
inputs:
project_url:
description: 'GitHub suffix of project to test (username/project)'
required: true
type: string
project_sha:
description: 'SHA of project to test'
required: true
type: string
jobs:
execute:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build NPMFilter container
run: docker build -t npmfilter .
- name: Run NPMFilter
id: run-npm-filter
env:
SHA: ${{ inputs.project_sha }}
URL: ${{ inputs.project_url }}
DOCKER_IMAGE: npmfilter:latest
run: |
IFS="/" read -r -a projectArray <<< "$URL"
OrgName=${projectArray[0]}
ProjectName=${projectArray[1]}
LogDir=${URL//\//-}
echo "LogDir=$LogDir" >> $GITHUB_OUTPUT
echo "Running NPMFilter on $OrgName/$ProjectName@$SHA"
mkdir -p docker_configs/
cat >docker_configs/debug_filter_config.json <<EOL
{
"install": {
"timeout": 1000,
"do_install": true
},
"dependencies": {
"track_deps": false,
"include_dev_deps": false
},
"build": {
"track_build": true,
"tracked_build_commands": ["build", "compile", "init"],
"timeout": 1000
},
"test": {
"track_tests": true,
"test_verbose_all_output": {
"do_verbose_tracking": true,
"verbose_json_output_file": "verbose_test_report.json"
},
"tracked_test_commands": ["test", "unit", "cov", "ci", "integration", "lint", "travis", "e2e", "bench",
"mocha", "jest", "ava", "tap", "jasmine"],
"timeout": 1000
},
"meta_info": {
"VERBOSE_MODE": true,
"ignored_commands": ["watch", "debug"],
"ignored_substrings": ["--watch", "nodemon"],
"rm_after_cloning": false,
"scripts_over_code": [ ],
"QL_queries": [ ]
}
}
EOL
# Run NPMFilter
./runDocker.sh python3 src/diagnose_github_repo.py --repo_link_and_SHA https://github.com/$URL $SHA --config docker_configs/debug_filter_config.json
# Get tests overview
python3 output_proc_scripts/count_tests_run.py npm_filter_docker_results/ > tests-overview.csv
# Check if tests were found
TestData=$(cat tests-overview.csv)
IFS="," read -r -a testCount <<< $(python3 output_proc_scripts/count_tests_run.py npm_filter_docker_results/)
TestsRun=${testCount[0]}
if [ $TestsRun -le 2 ]; then
echo "ERROR: No tests found."
exit -1
else
echo "OK: ${TestsRun} tests found!"
fi
echo "LOGNAME=results-${OrgName}-${ProjectName}-${SHA}" >> "$GITHUB_OUTPUT"
- name: Upload output
uses: actions/upload-artifact@v2
with:
name: ${{ steps.run-npm-filter.outputs.LOGNAME }}
path: npm_filter_docker_results