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

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
pyramation committed Apr 20, 2024
1 parent f119eb7 commit 651d3e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
7 changes: 5 additions & 2 deletions ci/client/__tests__/__snapshots__/client.deps.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`StarshipClient has all deps 2`] = `"something"`;
exports[`StarshipClient missing deps 1`] = `
"Call: exec(["something"])
Log⬇
✓kubectl
xkubectl
xdocker
✓helm
EndLog⬆
Expand All @@ -21,8 +21,11 @@ EndLog⬆
Log⬇
kubectl: https://kubernetes.io/docs/tasks/tools/
docker: https://docs.docker.com/get-docker/
For macOS, you may also consider Docker for Mac: https://docs.docker.com/desktop/install/mac-install/
For advanced Docker usage and installation on other platforms, see: https://docs.docker.com/get-docker/
EndLog⬆
Expand Down
2 changes: 1 addition & 1 deletion ci/client/__tests__/client.deps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('StarshipClient', () => {
const { client, ctx } = createClient();

client.dependencies = client.dependencies.map(dep=>{
if (['docker'].includes(dep.name)) {
if (['kubectl', 'docker'].includes(dep.name)) {
return {
...dep,
installed: false
Expand Down
7 changes: 4 additions & 3 deletions ci/client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import chalk from 'chalk';
import deepmerge from 'deepmerge';
import { existsSync, readFileSync, writeFileSync } from 'fs';
import * as yaml from 'js-yaml';
import { mkdirp } from 'mkdirp';
import * as os from 'os';
import { dirname } from 'path';
import * as shell from 'shelljs';

import { Chain, StarshipConfig } from './config';
import { Ports } from './config';
import { dependencies as defaultDependencies, Dependency } from "./deps";
import { readAndParsePackageJson } from './package';
import { mkdirp } from 'mkdirp';
import { dirname } from 'path';

export interface StarshipContext {
helmName: string;
Expand Down Expand Up @@ -93,7 +93,8 @@ export class StarshipClient implements StarshipClientI{
private checkDependencies(): void {
if (this.depsChecked) return;

const platform = os.platform();
// so CI/CD and local dev work nicely
const platform = process.env.NODE_ENV === 'test' ? 'linux' : os.platform();
const messages: string[] = [];
const depMessages: string[] = [];
const missingDependencies = this.dependencies.filter(dep => !dep.installed);
Expand Down

0 comments on commit 651d3e6

Please sign in to comment.