Skip to content

Commit

Permalink
Fix tests scripting (#153)
Browse files Browse the repository at this point in the history
* Removed references to SystemTest (#134)

* Added README instructions for building and link to examples (#136)

* Zip all map (#138)

* add ZipAllMap, and some doc comments and tests

* add doctests to pr.sh

---------

Co-authored-by: Zachery Olson <[email protected]>

* Adds skipBody CLI argument - Skips Request and Response Body in Try Output (#140)

* Cargo version upgrade

* Updated the Guide to include the new available flag options for instructional purposes

* Added the ability to include skipBody argument in TryConfig and modified output to honor new skip flag

* included the new argument in the TmpTryConfig for testing purposes

* change version upgrade back to original as requested

* Removed unnessesary matches as requested

* Changes made to output format as requested

* Format changes as requested

* format changes as requested by Rustfmt in the github checks

* Manually fixed format errors

* Fixed additional fmt failure after updating rust to 1.72

---------

Co-authored-by: Trevor McMaster <[email protected]>

* Updated dependencies and fixed deprecations (#143)

* Updated dependencies and fixed deprecations

* Updated Wasm-pack to match the version in the 0.6.0 scripting branch

* Example wasm tests (#147)

* Added additional tests for all the example yaml files

* Updated the README for the current changes

* Open source PPaaS (#149)

* Added initial common directory

* Added open source agent code

* Added initial controller check-in

- Not fully working. Need to get monorepo set up

* Removed references to familysearch.org

* Added code to the pr script to build the hdr-histogram for the controller

* Attempt to fix the common install/build issues in the controller

* Added code to make a monorepo out of the common, agent, and controller

* Added new PPaaS PR flow

- Renamed the old flows to show what they are testing
- Changed the guide PR to only monitor the guide files
- Added new flow for the PPaaS common, agent, and controller

* Updated the PR flow and added husky

* Added the .env.test files we're missing for the github action

* Changed all catch blocks to catch unknown

- Added type checking around the S3 errors

* Basic working build

* Working version of next buildgit status!

* Fixed storybook by removing reference to deprecated zlib

* Removed references to fslocal.org examples

* Removed husky since it's not needed on all check-ins

* Removed duplication in pr script

* Re-enabled the react build now that it's working

* Fixed the Application Name for the controller for unit tests

* Added code to generage a .env.local for the build

* Changed the .env.local file to environment variables

* Cleaned up the global script to improve performance and nyc output

* Fixed the nyc merge

* Changed the build environment files back to .env so it can be overridden

- environment variables override all .env files.

* Removed unneeded vars

* Added mock restore

* Fixed grouping of tests into describe

* Added AGENT_APPLICATION_NAME similar to the controller name

* Removed unneeded comment

* Removed additional unneeded vars

* Fix tests (#152)

* Removed unneeded vars

* Added mock restore

* Fixed grouping of tests into describe

* Added AGENT_APPLICATION_NAME similar to the controller name

* Removed unneeded comment

* Fixed cargo lock file

* Fixed duplication and issues from merge

* Fixed merge change

---------

Co-authored-by: Zachery Olson <[email protected]>
Co-authored-by: Idel <[email protected]>
  • Loading branch information
3 people committed Sep 29, 2023
1 parent de04df8 commit d867a67
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 839 deletions.
241 changes: 105 additions & 136 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion agent/createtest/createtest.scripting.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
vars:
rampTime: 1m
loadTime: 1m
totalTime: 2m
serviceUrlAgent: ${e:SERVICE_URL_AGENT}
load_pattern:
- !linear
Expand Down
1 change: 0 additions & 1 deletion agent/createtest/createtest.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
vars:
rampTime: 1m
loadTime: 1m
totalTime: 2m
serviceUrlAgent: ${SERVICE_URL_AGENT}
load_pattern:
- linear:
Expand Down
1 change: 0 additions & 1 deletion agent/createtest/shorter/createtest.scripting.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
vars:
rampTime: 1m
loadTime: 1m
totalTime: 2m
serviceUrlAgent: ${e:SERVICE_URL_AGENT}
load_pattern:
- !linear
Expand Down
1 change: 0 additions & 1 deletion agent/createtest/shorter/createtest.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
vars:
rampTime: 1m
loadTime: 1m
totalTime: 2m
serviceUrlAgent: ${SERVICE_URL_AGENT}
load_pattern:
- linear:
Expand Down
1 change: 0 additions & 1 deletion common/src/util/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export function init (): void {
// Where <prefix> is your application name, system name, and service name concatenated with underscores, capitalized, and all dashes replaced with underscores.
// The s3 service name is s3 in the application which is then capitalized to _S3_ below

// We need to error check if we're running on application we don't fall back to the unittests on live
const PREFIX: string = getPrefix(true); // Use the controller if we have one
const bucketName: string | undefined = process.env[`${PREFIX}_S3_BUCKET_NAME`];
log(`${PREFIX}_S3_BUCKET_NAME = ${bucketName}`, LogLevel.DEBUG);
Expand Down
11 changes: 8 additions & 3 deletions common/src/util/sqs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { AGENT_ENV, SYSTEM_NAME, getPrefix } from "./util";
import {
AGENT_APPLICATION_NAME,
AGENT_ENV,
SYSTEM_NAME,
getPrefix
} from "./util";
import {
ChangeMessageVisibilityCommand,
ChangeMessageVisibilityCommandInput,
Expand Down Expand Up @@ -43,7 +48,7 @@ export function init () {
// Controller should have this env variable from the deployment
const systemNames: string[] = AGENT_ENV.split(",");
for (const systemName of systemNames) {
const PREFIX: string = "PEWPEWAGENT_" + systemName.toUpperCase().replace("-", "_");
const PREFIX: string = (AGENT_APPLICATION_NAME + "_" + systemName).toUpperCase().replace("-", "_");
const queueUrlTest: string | undefined = process.env[`${PREFIX}_SQS_SCALE_OUT_QUEUE_URL`];
log(`${PREFIX}_SQS_SCALE_OUT_QUEUE_URL = ${queueUrlTest}`, LogLevel.DEBUG);
if (!queueUrlTest) {
Expand Down Expand Up @@ -72,7 +77,7 @@ export function init () {
// Controller should have this env variable from the deployment
const systemNames: string[] = AGENT_ENV.split(",");
for (const systemName of systemNames) {
const PREFIX: string = "PEWPEWAGENT_" + systemName.toUpperCase().replace("-", "_");
const PREFIX: string = (AGENT_APPLICATION_NAME + "_" + systemName).toUpperCase().replace("-", "_");
const queueUrlTest: string | undefined = process.env[`${PREFIX}_SQS_SCALE_IN_QUEUE_URL`];
log(`${PREFIX}_SQS_SCALE_IN_QUEUE_URL = ${queueUrlTest}`, LogLevel.DEBUG);
if (!queueUrlTest) {
Expand Down
1 change: 1 addition & 0 deletions common/src/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { LogLevel, log } from "./log";

export const APPLICATION_NAME: string = process.env.APPLICATION_NAME || "pewpewagent";
export const CONTROLLER_APPLICATION_NAME: string = process.env.CONTROLLER_APPLICATION_NAME || "pewpewcontroller";
export const AGENT_APPLICATION_NAME: string = process.env.AGENT_APPLICATION_NAME || "pewpewagent";
export const CONTROLLER_APPLICATION_PREFIX: string = CONTROLLER_APPLICATION_NAME.toUpperCase().replace(/-/g, "_") + "_";
export const SYSTEM_NAME: string = process.env.SYSTEM_NAME || "unittests";
export const CONTROLLER_ENV = process.env.CONTROLLER_ENV;
Expand Down
1 change: 0 additions & 1 deletion common/test/scriptingwithvars.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
vars:
rampTime: 1m
loadTime: 1m
totalTime: 2m
serviceUrlAgent: 127.0.0.1:8080
load_pattern:
- !linear
Expand Down
2 changes: 0 additions & 2 deletions controller/components/YamlViewer/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import React from "react";
const yamlContents = `vars:
rampTime: 1m
loadTime: 1m
totalTime: 2m
serviceUrlAgent: \${SERVICE_URL_AGENT}
load_pattern:
- linear:
Expand All @@ -38,7 +37,6 @@ endpoints:
const yamlContentsLarge = `vars:
rampTime: 1m
loadTime: 1m
totalTime: 2m
logDir: \${SPLUNK_PATH}
load_pattern:
- linear:
Expand Down
1 change: 0 additions & 1 deletion controller/test/basicwithenv.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
vars:
rampTime: 1m
loadTime: 1m
totalTime: 2m
serviceUrlAgent: ${SERVICE_URL_AGENT}
test1: ${TEST1}
test2: ${TEST2}
Expand Down
Loading

0 comments on commit d867a67

Please sign in to comment.