Skip to content
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

chore(smoke-tests): move files into its own package #6625

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ functions:
if [[ "$IS_OSX" == "true" ]]; then
echo "Disabling clipboard usage in e2e tests (TODO: https://jira.mongodb.org/browse/BUILD-14780)"
export COMPASS_E2E_DISABLE_CLIPBOARD_USAGE="true"
npm run --unsafe-perm --workspace compass-e2e-tests smoketest -- --package=osx_dmg
npm run --unsafe-perm --workspace @mongodb-js/compass-smoke-tests start -- --package=osx_dmg
# TODO: osx_zip
fi

Expand Down
156 changes: 154 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions packages/compass-e2e-tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ fixtures/*.csv
fixtures/*.json
hadron-build-info.json

# Ignoring sandboxes (created per test run)
.smoke-sandboxes/
# Cache of downloaded binaries
.smoke-downloads/
5 changes: 0 additions & 5 deletions packages/compass-e2e-tests/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ fixtures
.nyc_output
coverage
hadron-build-info.json

# Ignoring sandboxes (created per test run)
.smoke-sandboxes/
# Cache of downloaded binaries
.smoke-downloads/
1 change: 0 additions & 1 deletion packages/compass-e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"semver": "^7.6.2",
"tree-kill": "^1.2.2",
"ts-node": "^10.9.1",
"undici-types": "^6",
"webdriverio": "^9.4.1",
"why-is-node-running": "^2.3.0",
"xvfb-maybe": "^0.2.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/compass-smoke-tests/.depcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignores:
- '@mongodb-js/prettier-config-compass'
- '@mongodb-js/tsconfig-compass'
7 changes: 7 additions & 0 deletions packages/compass-smoke-tests/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.nyc-output
dist

# Sandboxes (created per test run)
.sandboxes/
# Cache of downloaded files
.downloads/
16 changes: 16 additions & 0 deletions packages/compass-smoke-tests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
extends: ['@mongodb-js/eslint-config-compass'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
overrides: [
{
files: ['**/*.ts'],
rules: {
'no-console': 0,
},
},
],
};
4 changes: 4 additions & 0 deletions packages/compass-smoke-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sandboxes (created per test run)
.sandboxes/
# Cache of downloaded files
.downloads/
8 changes: 8 additions & 0 deletions packages/compass-smoke-tests/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.nyc_output
dist
coverage

# Sandboxes (created per test run)
.sandboxes/
# Cache of downloaded files
.downloads/
1 change: 1 addition & 0 deletions packages/compass-smoke-tests/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@mongodb-js/prettier-config-compass"
45 changes: 45 additions & 0 deletions packages/compass-smoke-tests/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@mongodb-js/compass-smoke-tests",
"description": "Smoke test suite for Compass app installers",
"author": {
"name": "MongoDB Inc",
"email": "[email protected]"
},
"private": true,
"bugs": {
"url": "https://jira.mongodb.org/projects/COMPASS/issues",
"email": "[email protected]"
},
"homepage": "https://github.com/mongodb-js/compass",
"version": "1.0.0",
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
},
"compass:exports": {},
"license": "SSPL",
"scripts": {
"start": "ts-node src/cli.ts",
"typecheck": "tsc -p tsconfig.json",
"eslint": "eslint",
"prettier": "prettier",
"lint": "npm run eslint . && npm run prettier -- --check .",
"depcheck": "compass-scripts check-peer-deps && depcheck",
"check": "npm run typecheck && npm run lint && npm run depcheck",
"check-ci": "npm run check",
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write ."
},
"devDependencies": {
"@types/node": "^20",
"@mongodb-js/eslint-config-compass": "^1.2.1",
"@mongodb-js/prettier-config-compass": "^1.1.1",
"@mongodb-js/tsconfig-compass": "^1.1.1",
"depcheck": "^1.4.1",
"eslint": "^7.25.0",
"hadron-build": "^25.6.1",
"lodash": "^4.17.21",
"prettier": "^2.7.1",
"typescript": "^5.0.4",
"yargs": "^17.7.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export function readPackageDetails(
export function writeAndReadPackageDetails(
context: SmokeTestsContext
): PackageDetails {
const compassDir = path.resolve(__dirname, '../../../compass');
const compassDir = path.resolve(__dirname, '../../compass');
const infoArgs = {
format: 'json',
dir: compassDir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import { pick } from 'lodash';
import { installMacDMG } from './installers/mac-dmg';
import { execute } from './installers/helpers';
import { execute } from './execute';
import {
type PackageDetails,
readPackageDetails,
writeAndReadPackageDetails,
} from './helpers/smoke-test/build-info';
import { createSandbox } from './helpers/smoke-test/directories';
import { downloadFile } from './helpers/smoke-test/downloads';
import {
type PackageKind,
SUPPORTED_PACKAGES,
} from './helpers/smoke-test/packages';
import { type SmokeTestsContext } from './helpers/smoke-test/context';
} from './build-info';
import { createSandbox } from './directories';
import { downloadFile } from './downloads';
import { type PackageKind, SUPPORTED_PACKAGES } from './packages';
import { type SmokeTestsContext } from './context';
import { installMacZIP } from './installers/mac-zip';

const SUPPORTED_PLATFORMS = ['win32', 'darwin', 'linux'] as const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from 'node:fs';
import path from 'node:path';

function ensureSandboxesDirectory() {
const sandboxesPath = path.resolve(__dirname, '../../.smoke-sandboxes');
const sandboxesPath = path.resolve(__dirname, '../.sandboxes');
if (!fs.existsSync(sandboxesPath)) {
fs.mkdirSync(sandboxesPath, { recursive: true });
}
Expand All @@ -24,7 +24,7 @@ export function createSandbox() {
}

export function ensureDownloadsDirectory() {
const downloadsPath = path.resolve(__dirname, '../../.smoke-downloads');
const downloadsPath = path.resolve(__dirname, '../.downloads');
if (!fs.existsSync(downloadsPath)) {
fs.mkdirSync(downloadsPath, { recursive: true });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import assert from 'node:assert';
import fs from 'node:fs';
import path from 'node:path';
import stream from 'node:stream';
import { type fetch as undiciFetch } from 'undici-types';

// Hacking types here because the DOM types doesn't match the fetch implemented by Node.js
const fetch = globalThis.fetch as unknown as typeof undiciFetch;
Comment on lines -6 to -8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the TS project has lib locked down, we no longer need this.


import { ensureDownloadsDirectory } from './directories';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'node:path';
import fs from 'node:fs';

import type { InstalledAppInfo, InstallablePackage } from './types';
import { execute } from './helpers';
import { execute } from '../execute';

export function installMacDMG({
appName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'node:path';
import fs from 'node:fs';

import type { InstalledAppInfo, InstallablePackage } from './types';
import { execute } from './helpers';
import { execute } from '../execute';

export function installMacZIP({
appName,
Expand Down
Loading
Loading