Skip to content

Commit 30e3e45

Browse files
authored
chore: remove monitors test from pr workflow (#695)
* chore: remove monitors test from pr workflow * rename integration_tests to snapshot_tests
1 parent feb68d8 commit 30e3e45

18 files changed

+14
-19
lines changed
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: integration-tests
1+
name: snapshot-tests
22

33
on:
44
push:
55
branches: [main]
66
pull_request:
77

88
jobs:
9-
integration-tests:
9+
snapshot-tests:
1010
runs-on: ubuntu-latest
1111

1212
steps:
@@ -35,10 +35,5 @@ jobs:
3535
env:
3636
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
3737
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
38-
run: ./scripts/run_integration_tests.sh
38+
run: ./scripts/run_snapshot_tests.sh
3939

40-
- name: Test getting recommended monitors
41-
env:
42-
DD_API_KEY: ${{ secrets.DD_API_KEY }}
43-
DD_APP_KEY: ${{ secrets.DD_APP_KEY }}
44-
run: npm run test:integration

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ module.exports = {
1010
clearMocks: true,
1111
collectCoverageFrom: ["src/**/*.ts"],
1212
testRegex: "(src\\/).*(\\.spec\\.ts)$",
13-
testPathIgnorePatterns: ["\\.snap$", "<rootDir>/node_modules/", "integration_tests/"],
13+
testPathIgnorePatterns: ["\\.snap$", "<rootDir>/node_modules/", "snapshot_tests/"],
1414
};

jest.integration.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ module.exports = {
99
testEnvironment: "<rootDir>/testEnvironment.js",
1010
clearMocks: true,
1111
collectCoverageFrom: ["src/**/*.ts"],
12-
testRegex: ["(integration_tests\\/).*(\\.spec\\.ts)$"],
12+
testRegex: ["(snapshot_tests\\/).*(\\.spec\\.ts)$"],
1313
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"prebuild": "./scripts/check_layers_json.sh",
1111
"build": "tsc",
1212
"test": "jest --config jest.config.js",
13-
"test:integration": "jest ./integration_tests --config jest.integration.config.js",
13+
"test:integration": "jest ./snapshot_tests --config jest.integration.config.js",
1414
"test:watch": "jest --watch",
1515
"coverage": "jest --coverage",
1616
"lint": "tslint --project tsconfig.json",
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
# Usage - run commands from repo root:
44
# To check if new changes to the plugin cause changes to any snapshots:
5-
# ./scripts/run_integration_tests.sh
5+
# ./scripts/run_snapshot_tests.sh
66
# To regenerate snapshots:
7-
# UPDATE_SNAPSHOTS=true ./scripts/run_integration_tests.sh
7+
# UPDATE_SNAPSHOTS=true ./scripts/run_snapshot_tests.sh
88

99
set -e
1010

11-
# To add new tests create a new yml file in the 'integration_tests' directory, append it to the SERVERLESS_CONFIGS array as well as creating a name for the
11+
# To add new tests create a new yml file in the 'snapshot_tests' directory, append it to the SERVERLESS_CONFIGS array as well as creating a name for the
1212
# snapshots that will be compared in your test. Add those snapshot names to the TEST_SNAPSHOTS and CORRECT_SNAPSHOTS arrays.
1313
# Note: Each yml config, test, and correct snapshot file should be at the same index in their own array. e.g. All the files for the forwarder test are at index 0.
1414
# In order for this script to work correctly these arrays should have the same amount of elements.
@@ -25,7 +25,7 @@ if [[ "$root_dir" =~ .*"serverless-plugin-datadog/scripts".* ]]; then
2525
exit 1
2626
fi
2727

28-
integration_tests_dir="$root_dir/integration_tests"
28+
snapshot_tests_dir="$root_dir/snapshot_tests"
2929
if [ "$UPDATE_SNAPSHOTS" = "true" ]; then
3030
echo "Overwriting snapshots in this execution"
3131
fi
@@ -36,7 +36,7 @@ yarn build
3636
echo "Serverless Framework version:"
3737
serverless --version
3838

39-
cd $integration_tests_dir
39+
cd $snapshot_tests_dir
4040
RAW_CFN_TEMPLATE=".serverless/cloudformation-template-update-stack.json"
4141
for ((i = 0; i < ${#SERVERLESS_CONFIGS[@]}; i++)); do
4242
echo "Running 'sls package' with ${SERVERLESS_CONFIGS[i]}"
@@ -68,17 +68,17 @@ for ((i = 0; i < ${#SERVERLESS_CONFIGS[@]}; i++)); do
6868
set +e # Dont exit right away if there is a diff in snapshots
6969
cd ..
7070

71-
python $scripts_dir/compare_snapshots.py $integration_tests_dir/${TEST_SNAPSHOTS[i]} $integration_tests_dir/${CORRECT_SNAPSHOTS[i]}
71+
python $scripts_dir/compare_snapshots.py $snapshot_tests_dir/${TEST_SNAPSHOTS[i]} $snapshot_tests_dir/${CORRECT_SNAPSHOTS[i]}
7272
return_code=$?
7373
set -e
7474
if [ $return_code -eq 0 ]; then
7575
echo "SUCCESS: There were no differences between the ${TEST_SNAPSHOTS[i]} and ${CORRECT_SNAPSHOTS[i]}"
7676
else
7777
echo "FAILURE: There were differences between the ${TEST_SNAPSHOTS[i]} and ${CORRECT_SNAPSHOTS[i]}. Review the diff output above."
78-
echo "If you expected the ${TEST_SNAPSHOTS[i]} to be different generate new snapshots by running this command from a development branch on your local repository: 'UPDATE_SNAPSHOTS=true ./scripts/run_integration_tests.sh'"
78+
echo "If you expected the ${TEST_SNAPSHOTS[i]} to be different generate new snapshots by running this command from a development branch on your local repository: 'UPDATE_SNAPSHOTS=true ./scripts/run_snapshot_tests.sh'"
7979
exit 1
8080
fi
81-
cd $integration_tests_dir
81+
cd $snapshot_tests_dir
8282
echo "===================================="
8383
done
8484
exit 0
File renamed without changes.
File renamed without changes.

integration_tests/correct_extension_apigateway_snapshot.json renamed to snapshot_tests/correct_extension_apigateway_snapshot.json

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)