-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from solo-io/automation
[bot] Merge automation
- Loading branch information
Showing
103 changed files
with
7,810 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
gloo-gateway/1-17/enterprise-istio-ambient/default/tests/proxies-changes.test.js.liquid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
const { execSync } = require('child_process'); | ||
const { expect } = require('chai'); | ||
const { diff } = require('jest-diff'); | ||
|
||
function delay(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
|
||
describe('Gloo snapshot stability test', function() { | ||
let contextName = process.env.{{ context | default: "CLUSTER1" }}; | ||
let delaySeconds = {{ delay | default: 5 }}; | ||
|
||
let firstSnapshot; | ||
|
||
it('should retrieve initial snapshot', function() { | ||
const output = execSync( | ||
`kubectl --context ${contextName} -n gloo-system exec deploy/gloo -- wget -O - localhost:9095/snapshots/proxies -q`, | ||
{ encoding: 'utf8' } | ||
); | ||
|
||
try { | ||
firstSnapshot = JSON.parse(output); | ||
} catch (err) { | ||
throw new Error('Failed to parse JSON output from initial snapshot: ' + err.message); | ||
} | ||
expect(firstSnapshot).to.be.an('object'); | ||
}); | ||
|
||
it('should not change after the given delay', async function() { | ||
await delay(delaySeconds * 1000); | ||
|
||
let secondSnapshot; | ||
try { | ||
const output2 = execSync( | ||
`kubectl --context ${contextName} -n gloo-system exec deploy/gloo -- wget -O - localhost:9095/snapshots/proxies -q`, | ||
{ encoding: 'utf8' } | ||
); | ||
secondSnapshot = JSON.parse(output2); | ||
} catch (err) { | ||
throw new Error('Failed to retrieve or parse the second snapshot: ' + err.message); | ||
} | ||
|
||
const firstJson = JSON.stringify(firstSnapshot, null, 2); | ||
const secondJson = JSON.stringify(secondSnapshot, null, 2); | ||
|
||
// Show only 2 lines of context around each change | ||
const diffOutput = diff(firstJson, secondJson, { contextLines: 2, expand: false }); | ||
|
||
if (! diffOutput.includes("Compared values have no visual difference.")) { | ||
console.error('Differences found between snapshots:\n' + diffOutput); | ||
throw new Error('Snapshots differ after the delay.'); | ||
} else { | ||
console.log('No differences found. The snapshots are stable.'); | ||
} | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
gloo-gateway/1-17/enterprise-istio-sidecar/default/tests/proxies-changes.test.js.liquid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
const { execSync } = require('child_process'); | ||
const { expect } = require('chai'); | ||
const { diff } = require('jest-diff'); | ||
|
||
function delay(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
|
||
describe('Gloo snapshot stability test', function() { | ||
let contextName = process.env.{{ context | default: "CLUSTER1" }}; | ||
let delaySeconds = {{ delay | default: 5 }}; | ||
|
||
let firstSnapshot; | ||
|
||
it('should retrieve initial snapshot', function() { | ||
const output = execSync( | ||
`kubectl --context ${contextName} -n gloo-system exec deploy/gloo -- wget -O - localhost:9095/snapshots/proxies -q`, | ||
{ encoding: 'utf8' } | ||
); | ||
|
||
try { | ||
firstSnapshot = JSON.parse(output); | ||
} catch (err) { | ||
throw new Error('Failed to parse JSON output from initial snapshot: ' + err.message); | ||
} | ||
expect(firstSnapshot).to.be.an('object'); | ||
}); | ||
|
||
it('should not change after the given delay', async function() { | ||
await delay(delaySeconds * 1000); | ||
|
||
let secondSnapshot; | ||
try { | ||
const output2 = execSync( | ||
`kubectl --context ${contextName} -n gloo-system exec deploy/gloo -- wget -O - localhost:9095/snapshots/proxies -q`, | ||
{ encoding: 'utf8' } | ||
); | ||
secondSnapshot = JSON.parse(output2); | ||
} catch (err) { | ||
throw new Error('Failed to retrieve or parse the second snapshot: ' + err.message); | ||
} | ||
|
||
const firstJson = JSON.stringify(firstSnapshot, null, 2); | ||
const secondJson = JSON.stringify(secondSnapshot, null, 2); | ||
|
||
// Show only 2 lines of context around each change | ||
const diffOutput = diff(firstJson, secondJson, { contextLines: 2, expand: false }); | ||
|
||
if (! diffOutput.includes("Compared values have no visual difference.")) { | ||
console.error('Differences found between snapshots:\n' + diffOutput); | ||
throw new Error('Snapshots differ after the delay.'); | ||
} else { | ||
console.log('No differences found. The snapshots are stable.'); | ||
} | ||
}); | ||
}); | ||
|
57 changes: 57 additions & 0 deletions
57
gloo-gateway/1-17/enterprise-vm/default/tests/proxies-changes.test.js.liquid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
const { execSync } = require('child_process'); | ||
const { expect } = require('chai'); | ||
const { diff } = require('jest-diff'); | ||
|
||
function delay(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
|
||
describe('Gloo snapshot stability test', function() { | ||
let contextName = process.env.{{ context | default: "CLUSTER1" }}; | ||
let delaySeconds = {{ delay | default: 5 }}; | ||
|
||
let firstSnapshot; | ||
|
||
it('should retrieve initial snapshot', function() { | ||
const output = execSync( | ||
`kubectl --context ${contextName} -n gloo-system exec deploy/gloo -- wget -O - localhost:9095/snapshots/proxies -q`, | ||
{ encoding: 'utf8' } | ||
); | ||
|
||
try { | ||
firstSnapshot = JSON.parse(output); | ||
} catch (err) { | ||
throw new Error('Failed to parse JSON output from initial snapshot: ' + err.message); | ||
} | ||
expect(firstSnapshot).to.be.an('object'); | ||
}); | ||
|
||
it('should not change after the given delay', async function() { | ||
await delay(delaySeconds * 1000); | ||
|
||
let secondSnapshot; | ||
try { | ||
const output2 = execSync( | ||
`kubectl --context ${contextName} -n gloo-system exec deploy/gloo -- wget -O - localhost:9095/snapshots/proxies -q`, | ||
{ encoding: 'utf8' } | ||
); | ||
secondSnapshot = JSON.parse(output2); | ||
} catch (err) { | ||
throw new Error('Failed to retrieve or parse the second snapshot: ' + err.message); | ||
} | ||
|
||
const firstJson = JSON.stringify(firstSnapshot, null, 2); | ||
const secondJson = JSON.stringify(secondSnapshot, null, 2); | ||
|
||
// Show only 2 lines of context around each change | ||
const diffOutput = diff(firstJson, secondJson, { contextLines: 2, expand: false }); | ||
|
||
if (! diffOutput.includes("Compared values have no visual difference.")) { | ||
console.error('Differences found between snapshots:\n' + diffOutput); | ||
throw new Error('Snapshots differ after the delay.'); | ||
} else { | ||
console.log('No differences found. The snapshots are stable.'); | ||
} | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
gloo-gateway/1-17/enterprise/default/tests/proxies-changes.test.js.liquid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
const { execSync } = require('child_process'); | ||
const { expect } = require('chai'); | ||
const { diff } = require('jest-diff'); | ||
|
||
function delay(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
|
||
describe('Gloo snapshot stability test', function() { | ||
let contextName = process.env.{{ context | default: "CLUSTER1" }}; | ||
let delaySeconds = {{ delay | default: 5 }}; | ||
|
||
let firstSnapshot; | ||
|
||
it('should retrieve initial snapshot', function() { | ||
const output = execSync( | ||
`kubectl --context ${contextName} -n gloo-system exec deploy/gloo -- wget -O - localhost:9095/snapshots/proxies -q`, | ||
{ encoding: 'utf8' } | ||
); | ||
|
||
try { | ||
firstSnapshot = JSON.parse(output); | ||
} catch (err) { | ||
throw new Error('Failed to parse JSON output from initial snapshot: ' + err.message); | ||
} | ||
expect(firstSnapshot).to.be.an('object'); | ||
}); | ||
|
||
it('should not change after the given delay', async function() { | ||
await delay(delaySeconds * 1000); | ||
|
||
let secondSnapshot; | ||
try { | ||
const output2 = execSync( | ||
`kubectl --context ${contextName} -n gloo-system exec deploy/gloo -- wget -O - localhost:9095/snapshots/proxies -q`, | ||
{ encoding: 'utf8' } | ||
); | ||
secondSnapshot = JSON.parse(output2); | ||
} catch (err) { | ||
throw new Error('Failed to retrieve or parse the second snapshot: ' + err.message); | ||
} | ||
|
||
const firstJson = JSON.stringify(firstSnapshot, null, 2); | ||
const secondJson = JSON.stringify(secondSnapshot, null, 2); | ||
|
||
// Show only 2 lines of context around each change | ||
const diffOutput = diff(firstJson, secondJson, { contextLines: 2, expand: false }); | ||
|
||
if (! diffOutput.includes("Compared values have no visual difference.")) { | ||
console.error('Differences found between snapshots:\n' + diffOutput); | ||
throw new Error('Snapshots differ after the delay.'); | ||
} else { | ||
console.log('No differences found. The snapshots are stable.'); | ||
} | ||
}); | ||
}); | ||
|
Oops, something went wrong.