File tree Expand file tree Collapse file tree 6 files changed +81
-3
lines changed Expand file tree Collapse file tree 6 files changed +81
-3
lines changed Original file line number Diff line number Diff line change 55coverage /
66docs /.vuepress /dist /
77node_modules /
8- sessions /
8+ sessions
9+ ! tests /sessions
910smocker
1011smocker.test
1112vendor /
Original file line number Diff line number Diff line change @@ -53,8 +53,13 @@ CADDY=$(GOPATH)/bin/caddy
5353$(CADDY ) :
5454 cd /tmp; go get github.com/caddyserver/caddy/v2/...
5555
56+ .PHONY : persistence
57+ persistence :
58+ rm -rf ./sessions || true
59+ cp -r tests/sessions sessions
60+
5661.PHONY : start
57- start : $(REFLEX )
62+ start : $(REFLEX ) persistence
5863 $(REFLEX ) --start-service \
5964 --decoration=' none' \
6065 --regex=' \.go$$' \
8085
8186PID_FILE =/tmp/$(APPNAME ) .test.pid
8287.PHONY : test-integration
83- test-integration : $(VENOM ) check-default-ports
88+ test-integration : $(VENOM ) check-default-ports persistence
8489 mkdir -p coverage
8590 go test -race -coverpkg=" ./..." -c . -o $(APPNAME ) .test
8691 SMOCKER_PERSISTENCE_DIRECTORY=./sessions ./$(APPNAME ) .test -test.coverprofile=coverage/test-integration-cover.out > /dev/null 2>&1 & echo $$ ! > $(PID_FILE )
Original file line number Diff line number Diff line change 1+ name : Persistance
2+ version : " 2"
3+ testcases :
4+ - name : Check Mocks
5+ steps :
6+ - type : http
7+ method : GET
8+ url : http://localhost:8081/mocks
9+ assertions :
10+ - result.statuscode ShouldEqual 200
11+ - result.bodyjson.__len__ ShouldEqual 1
12+ - result.bodyjson.bodyjson0.state.id ShouldEqual YnJEM95SR
13+ - name : Check History
14+ steps :
15+ - type : http
16+ method : GET
17+ url : http://localhost:8081/history
18+ assertions :
19+ - result.statuscode ShouldEqual 200
20+ - result.bodyjson.__len__ ShouldEqual 1
21+ - result.bodyjson.bodyjson0.context.mock_id ShouldEqual YnJEM95SR
22+ - name : Check Sessions
23+ steps :
24+ - type : http
25+ method : GET
26+ url : http://localhost:8081/sessions
27+ assertions :
28+ - result.statuscode ShouldEqual 200
29+ - result.bodyjson.__len__ ShouldEqual 1
30+ - result.bodyjson.bodyjson0.id ShouldEqual 3giPMr5IR
31+ - result.bodyjson.bodyjson0.history.__len__ ShouldEqual 1
32+ - result.bodyjson.bodyjson0.mocks.__len__ ShouldEqual 1
Original file line number Diff line number Diff line change 1+ - context :
2+ mockid : YnJEM95SR
3+ mocktype : static
4+ delay : " "
5+ request :
6+ path : /test
7+ method : GET
8+ date : 2024-01-22T21:06:00.547178247+01:00
9+ response :
10+ status : 200
11+ body :
12+ message : test
13+ headers :
14+ Content-Type :
15+ - application/json
16+ date : 2024-01-22T21:06:00.547400418+01:00
Original file line number Diff line number Diff line change 1+ - request :
2+ path :
3+ matcher : ShouldEqual
4+ value : /test
5+ method :
6+ matcher : ShouldEqual
7+ value : GET
8+ response :
9+ body : |
10+ {"message": "test"}
11+ status : 200
12+ headers :
13+ Content-Type :
14+ - application/json
15+ context :
16+ times : 1
17+ state :
18+ id : YnJEM95SR
19+ times_count : 0
20+ locked : false
21+ creation_date : 2024-01-22T21:05:27.349554475+01:00
Original file line number Diff line number Diff line change 1+ - id : 3giPMr5IR
2+ name : ' Session #1'
3+ date : 2024-01-22T21:05:11.838034004+01:00
You can’t perform that action at this time.
0 commit comments