Skip to content

Commit f5a6d1a

Browse files
Revert "Prod deployment"
1 parent 3aacb82 commit f5a6d1a

File tree

6 files changed

+17
-30
lines changed

6 files changed

+17
-30
lines changed

.circleci/config.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ parameters:
88
type: boolean
99
defaults: &defaults
1010
docker:
11-
- image: cimg/python:3.11.0-browsers
11+
- image: circleci/python:2.7-stretch-browsers
1212
install_dependency: &install_dependency
1313
name: Installation of build and deployment dependencies.
1414
command: |
15-
sudo apt update
1615
sudo apt install jq python3-pip
17-
# sudo pip install docker-compose
1816
sudo pip3 install awscli --upgrade
19-
sudo pip3 install docker-compose
17+
# sudo pip install docker-compose
2018
install_deploysuite: &install_deploysuite
2119
name: Installation of install_deploysuite.
2220
command: |
@@ -25,10 +23,10 @@ install_deploysuite: &install_deploysuite
2523
cp ./../buildscript/buildenv.sh .
2624
cp ./../buildscript/awsconfiguration.sh .
2725
restore_cache_settings_for_build: &restore_cache_settings_for_build
28-
key: docker-node-modules-{{ checksum "yarn.lock" }}
26+
key: docker-node-modules-{{ checksum "package-lock.json" }}
2927

3028
save_cache_settings: &save_cache_settings
31-
key: docker-node-modules-{{ checksum "yarn.lock" }}
29+
key: docker-node-modules-{{ checksum "package-lock.json" }}
3230
paths:
3331
- node_modules
3432

@@ -97,13 +95,12 @@ jobs:
9795
- run: *install_deploysuite
9896
- run:
9997
name: 'newman test'
100-
no_output_timeout: 30m
10198
command: |
10299
./awsconfiguration.sh $DEPLOY_ENV
103100
source awsenvconf
104101
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-qa-appvar
105102
source buildenvvar
106-
npm install --loglevel verbose
103+
npm i
107104
cd mock
108105
(npm run mock-challenge-api&)
109106
(NODE_ENV=test npm start&)

Verification.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,4 @@ Iteration 4/4
9494

9595
Then you can run `npm run test:newman:clear` to delete all testing data by above postman tests.
9696
If 'socket hang up' appears while running the `npm run test:newman`. You can increase the `WAIT_TIME` from the `default/test.js`.
97-
Then run `npm run test:newman:clear` before calling `npm run test:newman` again.
98-
97+
Then run `npm run test:newman:clear` before calling `npm run test:newman` again.

app-constants.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ const UserRoles = {
1010
}
1111

1212
const ChallengeStatuses = {
13-
Completed: 'Completed',
14-
Active: 'Active'
13+
Completed: 'Completed'
1514
}
1615

1716
module.exports = {

config/test.js

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,5 @@ module.exports = {
1717
COPILOT_CREDENTIALS_PASSWORD: process.env.COPILOT_CREDENTIALS_PASSWORD || '',
1818
USER_CREDENTIALS_USERNAME: process.env.USER_CREDENTIALS_USERNAME || '',
1919
USER_CREDENTIALS_PASSWORD: process.env.USER_CREDENTIALS_PASSWORD || '',
20-
MANAGER_CREDENTIALS_USERNAME: process.env.MANAGER_CREDENTIALS_USERNAME || '',
21-
MANAGER_CREDENTIALS_PASSWORD: process.env.MANAGER_CREDENTIALS_PASSWORD || '',
2220
AUTOMATED_TESTING_REPORTERS_FORMAT: process.env.AUTOMATED_TESTING_REPORTERS_FORMAT || ['cli', 'html']
2321
}

src/services/ResourceService.js

-4
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,6 @@ async function init (currentUser, challengeId, resource, isCreated) {
231231
throw new errors.BadRequestError('Cannot delete resources of a completed challenge!')
232232
}
233233

234-
if (_.get(challenge, 'status') !== constants.ChallengeStatuses.Active && isCreated && resource.roleId === config.SUBMITTER_RESOURCE_ROLE_ID) {
235-
throw new errors.BadRequestError(`Cannot create submitter resource on challenge with status ${_.get(challenge, 'status')}`)
236-
}
237-
238234
// Prevent from creating more than 1 submitter resources on tasks
239235
if (_.get(challenge, 'task.isTask', false) && isCreated && resource.roleId === config.SUBMITTER_RESOURCE_ROLE_ID) {
240236
const existing = await getResources(currentUser, challengeId, config.SUBMITTER_RESOURCE_ROLE_ID, null, null, 1, 1)

test/postman/newman.js

+10-12
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,15 @@ async function clearTestData () {
183183
/**
184184
* Run the postman tests.
185185
*/
186-
clearTestData().then(() => {
187-
apiTestLib.runTests(requests, require.resolve('./resource-api.postman_collection.json'),
188-
require.resolve('./resource-api.postman_environment.json')).then(async () => {
189-
logger.info('newman test completed!')
190-
await clearTestData()
191-
}).catch(async (err) => {
192-
logger.logFullError(err)
186+
apiTestLib.runTests(requests, require.resolve('./resource-api.postman_collection.json'),
187+
require.resolve('./resource-api.postman_environment.json')).then(async () => {
188+
logger.info('newman test completed!')
189+
await clearTestData()
190+
}).catch(async (err) => {
191+
logger.logFullError(err)
193192

194-
// Only calling the clean up function when it is not validation error.
195-
if (err.name !== 'ValidationError') {
196-
await clearTestData()
197-
}
198-
})
193+
// Only calling the clean up function when it is not validation error.
194+
if (err.name !== 'ValidationError') {
195+
await clearTestData()
196+
}
199197
})

0 commit comments

Comments
 (0)