Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
test(integration): use seleniarm (#1236)
Browse files Browse the repository at this point in the history
* test(integration): use seleniarm

* chore(prod-sample): enable skip api docker image builds

* chore(prod-sample): skip cert generation

* chore(build-one-app-docker): re-order cert creation
  • Loading branch information
JAdshead authored Jan 16, 2024
1 parent 6f8c847 commit 8dcf111
Show file tree
Hide file tree
Showing 10 changed files with 554 additions and 265 deletions.
4 changes: 2 additions & 2 deletions __performance__/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ You can now view the [Grafana metrics on localhost:3030](http://localhost:3030/d
In another new window from within `one-app/__performance__` run the following:

```bash
docker-compose -f docker-compose.yml -f docker-compose.prod-sample.yml run k6 run --insecure-skip-tls-verify /scripts/smoke.js
docker compose -f docker-compose.yml -f docker-compose.prod-sample.yml run k6 run --insecure-skip-tls-verify /scripts/smoke.js
```

Each file under `__perforamance__/scripts` correlates to a different test:
Expand Down Expand Up @@ -137,7 +137,7 @@ You can now view the [Grafana metrics on localhost:3030](http://localhost:3030/d
In another new window from within `one-app/__performance__` run the following:

```bash
docker-compose run -e TARGET_URL=http://host.docker.internal:3000/success k6 run /scripts/smoke.js
docker compose run -e TARGET_URL=http://host.docker.internal:3000/success k6 run /scripts/smoke.js
```

Replace the `TARGET_URL` value with your intended target domain.
Expand Down
5 changes: 4 additions & 1 deletion __tests__/integration/helpers/testRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const setUpTestRunner = async ({
'selenium-chrome': {
ports: [
`${seleniumServerPort}:4444`,
'7901:7900',
'5901:5900',
],
},
...oneAppLocalPortToUse && {
Expand All @@ -65,7 +67,7 @@ const setUpTestRunner = async ({

fs.writeFileSync(pathToDockerComposeTestFile, yaml.dump(testDockerComposeFileContents));

const dockerComposeUpCommand = `docker-compose -f ${pathToDockerComposeTestFile} up --abort-on-container-exit --force-recreate`;
const dockerComposeUpCommand = `docker compose -f ${pathToDockerComposeTestFile} up --abort-on-container-exit --force-recreate`;
const dockerComposeUpProcess = childProcess.spawn(`${dockerComposeUpCommand}`, { shell: true });
const serverStartupTimeout = 90000;

Expand Down Expand Up @@ -103,6 +105,7 @@ const setUpTestRunner = async ({
path: '/wd/hub',
port: seleniumServerPort,
capabilities: {
acceptInsecureCerts: true,
'goog:chromeOptions': {
...!oneAppLocalPortToUse && process.env.HTTPS_PROXY
&& { args: [`--proxy-server=${process.env.HTTPS_PROXY}`] },
Expand Down
4 changes: 2 additions & 2 deletions __tests__/integration/one-app.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ describe('Tests that require Docker setup', () => {
{
level: 'SEVERE',
message: expect.stringMatching(
/https:\/\/one-app:8443\/demo\/healthy-frank - Failed to find a valid digest in the 'integrity' attribute for resource 'https:\/\/sample-cdn\.frank\/modules\/.+\/healthy-frank\/0\.0\.0\/healthy-frank.browser.js' with computed SHA-256 integrity '.+'\. The resource has been blocked\./
/https:\/\/one-app:8443\/demo\/healthy-frank - Failed to find a valid digest in the 'integrity' attribute for resource 'https:\/\/sample-cdn\.frank\/modules\/.+\/healthy-frank\/0\.0\.0\/healthy-frank.browser.js' with computed SHA-384 integrity '.+'\. The resource has been blocked\./
),
source: 'security',
timestamp: expect.any(Number),
Expand Down Expand Up @@ -1711,7 +1711,7 @@ describe('Tests that can run against either local Docker setup or remote One App
'accept-language': 'en-US,en;q=0.9',
host: expect.any(String),
'user-agent':
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
},
method: 'GET',
originalUrl: '/vitruvius',
Expand Down
Loading

0 comments on commit 8dcf111

Please sign in to comment.