mirror of
				https://github.com/MontFerret/ferret.git
				synced 2025-10-30 23:37:40 +02:00 
			
		
		
		
	
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -126,4 +126,5 @@ vendor | ||||
| bin | ||||
| *.log | ||||
| *.orig | ||||
| dist | ||||
| dist | ||||
| coverage.txt | ||||
							
								
								
									
										13
									
								
								.travis.yml
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								.travis.yml
									
									
									
									
									
								
							| @@ -47,11 +47,14 @@ jobs: | ||||
|     - make generate | ||||
|     - make compile | ||||
|   - stage: test | ||||
|     script: make test | ||||
|   - stage: e2e | ||||
|     script: | ||||
|     - make cover | ||||
|     after_success: | ||||
|     - bash <(curl -s https://codecov.io/bash) | ||||
|   - stage: e2e | ||||
|     before_script: | ||||
|     - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 --disable-setuid-sandbox --no-sandbox about:blank & | ||||
|     script: | ||||
|     - make e2e | ||||
|  | ||||
| after_script: | ||||
| - killall google-chrome-stable | ||||
|     after_script: | ||||
|     - killall google-chrome-stable | ||||
							
								
								
									
										5
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								Makefile
									
									
									
									
									
								
							| @@ -21,7 +21,10 @@ install: | ||||
| 	dep ensure | ||||
|  | ||||
| test: | ||||
| 	go test ${DIR_PKG}/... | ||||
| 	go test -race ${DIR_PKG}/... | ||||
|  | ||||
| cover: | ||||
| 	go test -race -coverprofile=coverage.txt -covermode=atomic ${DIR_PKG}/... | ||||
|  | ||||
| e2e: | ||||
| 	go run ${DIR_E2E}/main.go --tests ${DIR_E2E}/tests --pages ${DIR_E2E}/pages | ||||
|   | ||||
| @@ -6,6 +6,7 @@ import ( | ||||
| 	"github.com/mafredri/cdp/protocol/page" | ||||
| 	. "github.com/smartystreets/goconvey/convey" | ||||
| 	"golang.org/x/sync/errgroup" | ||||
| 	"sync/atomic" | ||||
| 	"testing" | ||||
| 	"time" | ||||
| ) | ||||
| @@ -293,9 +294,10 @@ func TestEventBroker(t *testing.T) { | ||||
| 			b := NewTestEventBroker() | ||||
| 			b.Start() | ||||
|  | ||||
| 			counter := 0 | ||||
| 			var counter int64 | ||||
|  | ||||
| 			b.AddEventListener(events.EventLoad, func(message interface{}) { | ||||
| 				counter++ | ||||
| 				atomic.AddInt64(&counter, 1) | ||||
| 				b.Stop() | ||||
| 			}) | ||||
|  | ||||
| @@ -313,7 +315,7 @@ func TestEventBroker(t *testing.T) { | ||||
|  | ||||
| 			time.Sleep(time.Duration(5) * time.Millisecond) | ||||
|  | ||||
| 			So(counter, ShouldEqual, 1) | ||||
| 			So(atomic.LoadInt64(&counter), ShouldEqual, 1) | ||||
| 		}) | ||||
| 	}) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user