Skip to content

Commit

Permalink
Fix test configuration (#1275)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Martinez Gotor authored Nov 6, 2019
1 parent 542a2f8 commit 2ff3399
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 19 deletions.
1 change: 1 addition & 0 deletions integration/jest.environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class ScreenshotOnFailureEnvironment extends PuppeteerEnvironment {
height: 780,
deviceScaleFactor: 1
});
await this.global.page.setDefaultTimeout(8000);
}

async teardown() {
Expand Down
3 changes: 3 additions & 0 deletions integration/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ global.endpoint = endpoint;

// Helper to get the proper endpoint
global.getUrl = path => `${global.endpoint}${path}`;

// Timeout for a test
jest.setTimeout(120000);
6 changes: 0 additions & 6 deletions integration/use-cases/create-registry.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const { setDefaultOptions } = require("expect-puppeteer");

setDefaultOptions({ timeout: 8000 });
jest.setTimeout(120000);

test("Creates a registry", async () => {
page.setDefaultTimeout(8000);
await page.goto(getUrl("/#/config/repos"));

await expect(page).toFillForm("form", {
Expand Down
6 changes: 0 additions & 6 deletions integration/use-cases/default-deployment.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const { setDefaultOptions } = require("expect-puppeteer");

setDefaultOptions({ timeout: 8000 });
jest.setTimeout(120000);

test("Deploys an application with the values by default", async () => {
page.setDefaultTimeout(8000);
await page.goto(getUrl("/#/login"));

await expect(page).toFillForm("form", {
Expand Down
6 changes: 0 additions & 6 deletions integration/use-cases/missing-permissions.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const { setDefaultOptions } = require("expect-puppeteer");

setDefaultOptions({ timeout: 8000 });
jest.setTimeout(120000);

test("Fails to deploy an application due to missing permissions", async () => {
page.setDefaultTimeout(8000);
await page.goto(getUrl("/#/login"));

await expect(page).toFillForm("form", {
Expand Down
3 changes: 2 additions & 1 deletion script/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ cd $ROOT_DIR/integration
kubectl apply -f manifests/executor.yaml
k8s_wait_for_deployment default integration
pod=$(kubectl get po -l run=integration -o jsonpath="{.items[0].metadata.name}")
## Copy latest tests
## Copy config and latest tests
for f in `ls *.js`; do kubectl cp ./${f} ${pod}:/app/; done
kubectl cp ./use-cases ${pod}:/app/
## Create admin user
kubectl create serviceaccount kubeapps-operator -n kubeapps
Expand Down

0 comments on commit 2ff3399

Please sign in to comment.