-
Notifications
You must be signed in to change notification settings - Fork 243
feat: add a basic CI script #752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
fb1da02
to
0e6a146
Compare
I'll squash this |
5f3734e
to
e50724b
Compare
e50724b
to
c0e609b
Compare
c095d71
to
960d8e5
Compare
This just makes sure the code compiles and passes some static analysis, doesn't run the tests since a lot of them hang on my system fix: remove branch restrictions for pull_request events in CI workflow forgot we don't push to main, my bad. if we had a dev branch I could filter it to only run on main and dev but since the "dev" branch changes every release let's just run it everywhere fix: specify cache-dependency-path fix: add concurrency settings to CI workflow only one run at a time per ref
960d8e5
to
fa5de3b
Compare
Here's a patch that will run an http server for the diff --git a/src/mod/dynamicproxy/dpcore/dpcore_test.go b/src/mod/dynamicproxy/dpcore/dpcore_test.go
index 4e33ffe..b4e18c1 100644
--- a/src/mod/dynamicproxy/dpcore/dpcore_test.go
+++ b/src/mod/dynamicproxy/dpcore/dpcore_test.go
@@ -90,13 +90,33 @@ func TestReplaceLocationHostRelative(t *testing.T) {
// Not sure why this test is not working, but at least this make the QA guy happy
func TestHTTP1p1KeepAlive(t *testing.T) {
+ // Start a simple HTTP server
+ // This server should have Keep-Alive enabled by default
+ errChan := make(chan error, 1)
+ go func() {
+ http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
+ w.WriteHeader(http.StatusOK)
+ w.Write([]byte("Hello, World!"))
+ })
+ err := http.ListenAndServe(":8080", nil)
+ if err != nil {
+ errChan <- err
+ }
+ }()
+ // Give the server a moment to start
+ select {
+ case err := <-errChan:
+ t.Fatal("ListenAndServe: ", err)
+ case <-time.After(2 * time.Second):
+ }
+
client := &http.Client{
Transport: &http.Transport{
DisableKeepAlives: false,
},
}
- req, err := http.NewRequest("GET", "http://localhost:80", nil)
+ req, err := http.NewRequest("GET", "http://localhost:8080", nil)
if err != nil {
t.Fatalf("Failed to create request: %v", err)
}
@@ -116,7 +136,7 @@ func TestHTTP1p1KeepAlive(t *testing.T) {
t.Logf("First request status code: %v", resp.StatusCode)
time.Sleep(20 * time.Second)
- req2, err := http.NewRequest("GET", "http://localhost:80", nil)
+ req2, err := http.NewRequest("GET", "http://localhost:8080", nil)
if err != nil {
t.Fatalf("Failed to create second request: %v", err)
} |
0356cd9
to
1fd659d
Compare
I guess this need to be left for later, since I have my own jenkin server for building (instead of using Github action for the binary build). I will see if I got time to integrate these. Let me change this merge target to main. |
Is there a way to link jenkins w/ GH so that there's more observability about which tests are failing and such? |
If a plugin fails to build, make sure to exit w/ a failing status code
Moving this to main so it won't get closed when I remove the v3.2.6 dev branch |
This just makes sure the code compiles and passes some static analysis,
doesn't run the tests since a lot of them hang on my system.Worth noting that the static analysis does currently fail, but that can be fixed.
If you want, I can do the fixes in this PR, or put it off for later, I don't mind either way.