You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The script below, `test-pr.py`, is a quick and easy way to run CUDA tests on a PR.
4
+
5
+
This should be done after code review, see [issue #457](https://github.com/tensor-compiler/taco/issues/457) for a discussion of the overall process.
6
+
7
+
## System requirements
8
+
9
+
You will need write access to the `tensor-compiler/taco` github repo, and access to run actions.
10
+
11
+
You will need to have the command line `git` and `gh` tools installed, configured, and talking to github.
12
+
13
+
`git` needs to be set up with SSH authentication or HTTPS authentication to push to the `tensor-compiler/taco` github repo without a password prompt. If you don't have that, please see [ssh setup in the github docs](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh) or [seting up an HTTPS token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token).
14
+
15
+
`gh` is a command-line interface to the github REST API. If you don't have `gh`, please see [their installation guide](https://github.com/cli/cli#installation).
16
+
17
+
`gh` needs to be set up to hit REST API endpoints without a password prompt. If you don't have that, the [gh auth login](https://cli.github.com/manual/gh_auth_login) command should help.
18
+
19
+
The script itself is `test-pr.py`, you can grab that below.
20
+
21
+
The script requires python version 3.x, and a few basic python modules that should be installed by default (like subprocess and tempfile).
22
+
23
+
## What it does
24
+
25
+
This script does the following:
26
+
27
+
* creates a temporary test branch for a PR
28
+
* pushes that test branch to the taco github repo
29
+
* kicks off the cuda test (with the default parameters) to run on that test branch
30
+
* waits for the test to complete
31
+
* removes the temporary test branch
32
+
33
+
The script will give you a link to the test run on the github website, so you can watch and inspect the results.
`PRNUMBER` is the PR you want to test, without the `#` prefix.
40
+
41
+
If specified, `TRYNUMBER` becomes a suffix for the temporary test branch, so you can have multiple test branches going at once. That can be omitted unless it is needed.
42
+
43
+
## what it looks like
44
+
45
+
This output comes from my own fork of taco as I was testing the script:
46
+
47
+
```
48
+
% python3 test-pr.py 3
49
+
50
+
=== looking up ID and params of test action
51
+
52
+
=== creating test branch test-pr3
53
+
remote:
54
+
remote: Create a pull request for 'test-pr3' on GitHub by visiting:
✓ Created workflow_dispatch event for cuda-test-manual.yml at test-pr3
60
+
61
+
To see runs for this workflow, try: gh run list --workflow=cuda-test-manual.yml
62
+
Test action is at: https://github.com/Infinoid/taco/actions/runs/882846018?check_suite_focus=true
63
+
64
+
=== waiting for action to complete
65
+
66
+
Refreshing run status every 3 seconds. Press Ctrl+C to quit.
67
+
68
+
X test-pr3 CUDA build and test (manual) · 882846018
69
+
Triggered via workflow_dispatch about 11 minutes ago
70
+
71
+
JOBS
72
+
X tests CUDA in 10m54s (ID 2686889157)
73
+
✓ Set up job
74
+
✓ Run actions/checkout@v2
75
+
✓ create_build
76
+
✓ cmake
77
+
✓ make
78
+
X test
79
+
✓ Post Run actions/checkout@v2
80
+
✓ Complete job
81
+
82
+
ANNOTATIONS
83
+
X Process completed with exit code 2.
84
+
tests CUDA: .github#1
85
+
86
+
87
+
X Run CUDA build and test (manual) (882846018) completed with 'failure'
88
+
Test results are at: https://github.com/Infinoid/taco/actions/runs/882846018?check_suite_focus=true
89
+
90
+
=== cleaning up test branch test-pr3
91
+
92
+
=== cleaning up temp dir
93
+
94
+
```
95
+
96
+
# Troubleshooting
97
+
98
+
## no access to taco repo, no access to run actions in taco repo
99
+
100
+
If you are a taco developer, ask Fred for access.
101
+
102
+
## test workflow does not exist
103
+
104
+
If you see output that looks like this:
105
+
106
+
```
107
+
=== triggering test action
108
+
could not create workflow dispatch event: HTTP 422: Workflow does not have 'workflow_dispatch' trigger (https://api.github.com/repos/tensor-compiler/taco/actions/workflows/someIDnumber/dispatches)
109
+
```
110
+
111
+
This means the test branch does not have the cuda test workflow file. In other words, the file `.github/workflows/cuda-test-manual.yml` does not exist yet in the version of taco that the PR is based on.
112
+
113
+
To fix this, rebase or merge the PR to the current taco master branch, and then rerun the test.
114
+
115
+
## other stuff
116
+
117
+
If you have some other problem with it, at me on github (@infinoid) or email me for help figuring it out.
0 commit comments