Просмотр исходного кода

ci github int tests settle (#459)

* ci: Allow more time for GitHub tests to settle

* ci: Run build-snapshot on any push, but dont dupe with PR
James Read 1 год назад
Родитель
Сommit
ee26fe6b50
2 измененных файлов с 10 добавлено и 3 удалено
  1. 0 2
      .github/workflows/build-snapshot.yml
  2. 10 1
      integration-tests/runner.mjs

+ 0 - 2
.github/workflows/build-snapshot.yml

@@ -4,8 +4,6 @@ name: "Build Snapshot"
 on:
 on:
   push:
   push:
   workflow_dispatch:
   workflow_dispatch:
-  pull_request:
-    branches: [main]
 
 
 jobs:
 jobs:
   build-snapshot:
   build-snapshot:

+ 10 - 1
integration-tests/runner.mjs

@@ -35,6 +35,8 @@ class OliveTinTestRunnerStartLocalProcess extends OliveTinTestRunner {
   async start (cfg) {
   async start (cfg) {
     let stdout = ""
     let stdout = ""
     let stderr = ""
     let stderr = ""
+    
+    console.log("      OliveTin starting local process...")
 
 
     this.ot = spawn('./../OliveTin', ['-configdir', 'configs/' + cfg + '/'])
     this.ot = spawn('./../OliveTin', ['-configdir', 'configs/' + cfg + '/'])
 
 
@@ -74,6 +76,8 @@ class OliveTinTestRunnerStartLocalProcess extends OliveTinTestRunner {
     if (this.ot.exitCode == null) {
     if (this.ot.exitCode == null) {
       this.BASE_URL = 'http://localhost:1337/'
       this.BASE_URL = 'http://localhost:1337/'
 
 
+      console.log("      OliveTin waiting for local process to start...")
+
       await waitOn({
       await waitOn({
         resources: [this.BASE_URL]
         resources: [this.BASE_URL]
       })
       })
@@ -95,7 +99,12 @@ class OliveTinTestRunnerStartLocalProcess extends OliveTinTestRunner {
       console.log("      OliveTin local process killed")
       console.log("      OliveTin local process killed")
     }
     }
 
 
-    await new Promise((res) => setTimeout(res, 100))
+    if (process.env.CI === 'true') {
+      // GitHub runners seem to need a bit more time to clean up
+      await new Promise((res) => setTimeout(res, 3000))
+    } else {
+      await new Promise((res) => setTimeout(res, 100))
+    }
   }
   }
 }
 }