Skip to content

Add a smoke test in build pipeline #355

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

Merged
merged 35 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e409e29
test
hossam-nasr Apr 27, 2022
6e94781
modify bash
hossam-nasr Apr 27, 2022
dda92f9
Update azure-pipelines.yml for Azure Pipelines
hossam-nasr Apr 27, 2022
8c1aa50
update comment
hossam-nasr Apr 27, 2022
9d0cfa3
fix UnitTests project
hossam-nasr Apr 27, 2022
50eb74a
Make all arguments to DummyOrchestrationContext optional
hossam-nasr Apr 27, 2022
0802431
install chai
hossam-nasr Apr 27, 2022
e700a11
simplify script
hossam-nasr Apr 27, 2022
c330295
update names
hossam-nasr Apr 28, 2022
8e84f17
add test app in test directory
hossam-nasr May 17, 2022
a23c1c5
update yaml
hossam-nasr May 17, 2022
22b9dcc
use built-in tasks and move to unit testing job
hossam-nasr May 18, 2022
38d568f
indent test app jsons and rename to Test
hossam-nasr May 18, 2022
0103eff
remove durable-functions from test app
hossam-nasr May 18, 2022
55c6579
fix build errors
hossam-nasr May 18, 2022
314d892
add uninstall durable-functions step just in case
hossam-nasr May 18, 2022
5d19dd3
add uninstall durable-functions step just in case
hossam-nasr May 18, 2022
b6df84f
naming
hossam-nasr May 18, 2022
a1b31eb
set package variable
hossam-nasr May 18, 2022
e9efa78
typo
hossam-nasr May 18, 2022
fd43667
properly reference variable
hossam-nasr May 18, 2022
b1977a9
switch to powershell
hossam-nasr May 18, 2022
39b84e3
explicitly specify powershell
hossam-nasr May 18, 2022
273a9c1
use full path of package
hossam-nasr May 18, 2022
cde503e
add some logging
hossam-nasr May 18, 2022
4812069
remove logging
hossam-nasr May 18, 2022
48ea0e7
explicitly use full name
hossam-nasr May 18, 2022
1bf56a5
try renaming package file
hossam-nasr May 18, 2022
30c309e
readme for test app
hossam-nasr May 19, 2022
7b920a7
Update README.md
hossam-nasr May 19, 2022
fc47f6e
reintroduce moment type error to test pipeline fails
hossam-nasr May 19, 2022
0afc044
Merge branch 'hossamnasr/build-pipeline' of github.com:Azure/azure-fu…
hossam-nasr May 19, 2022
c10bdd6
try script step instead of npm task
hossam-nasr May 19, 2022
4455033
revert moment type error
hossam-nasr May 19, 2022
09aef15
update and fix pipeline
hossam-nasr May 20, 2022
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/**
lib/**
samples/node_modules/**
test/test-app/node_modules/**
24 changes: 23 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trigger:
- dev

jobs:
- job: UnitTests
- job: Test
strategy:
matrix:
UBUNTU_NODE10:
Expand Down Expand Up @@ -65,6 +65,28 @@ jobs:
displayName: "npm build and test"
- script: npm run test:nolint
displayName: "npm build and test (no linting)"
- script: npm run build
displayName: "npm run build"
- script: npm pack
displayName: "npm pack"
- script: mv durable-functions-*.tgz package.tgz
displayName: "Rename package file"
- task: CopyFiles@2
displayName: "Create smoke test app"
inputs:
SourceFolder: "$(System.DefaultWorkingDirectory)/test/test-app"
Contents: "**"
TargetFolder: "$(Agent.BuildDirectory)/test-app"
CleanTargetFolder: true
- script: npm install $(System.DefaultWorkingDirectory)/package.tgz
displayName: "Install packed durable-functions module (test app)"
workingDirectory: $(Agent.BuildDirectory)/test-app
- script: npm install
displayName: "npm install (test app)"
workingDirectory: $(Agent.BuildDirectory)/test-app
- script: npm run build
displayName: "Build smoke test app"
workingDirectory: "$(Agent.BuildDirectory)/test-app"
- job: BuildArtifacts
pool:
name: "1ES-Hosted-AzFunc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* function app in Kudu
*/

import * as df from "../../../";
import * as df from "durable-functions";

const orchestrator = df.orchestrator(function* (context) {
const outputs = [];
Expand Down
132 changes: 132 additions & 0 deletions samples/UnitTesting/package-lock.json

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

2 changes: 2 additions & 0 deletions samples/UnitTesting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"test": "mocha"
},
"dependencies": {
"chai": "^4.3.6",
"durable-functions": "^1.4.6",
"esm": "^3.2.25",
"mocha": "^9.2.2",
Expand All @@ -19,6 +20,7 @@
},
"devDependencies": {
"@azure/functions": "^1.2.3",
"@types/mocha": "^9.1.1",
"typescript": "^4.0.0"
}
}
6 changes: 3 additions & 3 deletions src/testingUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export class DummyOrchestrationContext implements IOrchestrationFunctionContext
history: HistoryEvent[] | undefined = undefined,
input: any = undefined,
currentUtcDateTime: Date = new Date(),
longRunningTimerIntervalDuration: string,
maximumShortTimerDuration: string,
schemaVersion: ReplaySchema,
longRunningTimerIntervalDuration = "3.00:00:00",
maximumShortTimerDuration = "6.00:00:00",
schemaVersion: ReplaySchema = ReplaySchema.V1,
isReplaying = false,
parentInstanceId = ""
) {
Expand Down
7 changes: 7 additions & 0 deletions test/test-app/.funcignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.js.map
*.ts
.git*
.vscode
local.settings.json
test
tsconfig.json
Loading