-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestingLocally.txt
More file actions
63 lines (46 loc) · 1.86 KB
/
Copy pathtestingLocally.txt
File metadata and controls
63 lines (46 loc) · 1.86 KB
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
## To manually read a payload
require 'json'
file = File.read("./payloadOpenIssue")
obj = JSON.parse(file)
## manually in ruby
obj = {"pkgname"=>"TENxIO", "commit_id"=>"99539deb2931b3cc16001eb60290038264349ca8"}
## Have a rabbitmq running locally
sudo docker run -d -e RABBITMQ_NODENAME=my-rabbit --name rabbitmq -p 61613:61613 resilva87/docker-rabbitmq-stomp
docker restart rabbitmq
## Change auth.yml to use localhost for stomp
## production uses rabbitmq.bioconductor.org
## launch app
ruby app.rb
## launch rest of spb locally
## https://github.com/Bioconductor/packagebuilder/blob/UpdateVersions/documentation/Developing.md
source ../env/bin/activate
python3 -m workers.server
python3 -m archiver
python3 -m track_build_completion
python3 -m manage runserver 0.0.0.0:8000
## test desired payloads by sending a post response to api endpoint using httr in R:
library(httr)
library(jsonlite)
library(readr)
## "nothing to see here"
GET("http://localhost:4567")
## Open issue payload that puts awaiting moderation and sends email
url = "http://localhost:4567"
payload = read_file("payloadOpenIssue")
temp = POST(url, body = payload)
##
## Moderation email has acceptance url like the following
## http://localhost:4567/moderate_new_issue/3140/approve/8f78f962215ad6f1b7871b553cfda3879e12e7bb
## This kicks off build and swaps tags
## Hard to mock this as last part is a bcrypt hash code and must be in package db
##
## To mock a call from the build system hook
url = "http://localhost:4567/start_build"
build_info = '{"pkgname":"spbtest5", "commit_id":"fdcf48d0e8e585d38b3b14554d97bf1d45bd007d"}'
temp = POST(url, body = build_info)
## Change Label payload
## Make sure the label in payload is the right one for testing as different
## labels result in different actions in the code
url = "http://localhost:4567"
payload = read_file("payloadLabeled")
temp = POST(url, body = payload)