Combining AND and OR in Catch2 test tags - catch2

I have a set of Catch2 test cases, segregated by language and by type. For example:
TEST_CASE("zh-CN CPU test", "[zh-CN][cpu]")
{
REQUIRE(result);
}
TEST_CASE("zh-CN verification test", "[zh-CN][ModelVerification]")
{
REQUIRE(result);
}
TEST_CASE("zh-HK CPU test", "[zh-HK][cpu]")
{
REQUIRE(result);
}
TEST_CASE("zh-HK verification test", "[zh-HK][ModelVerification]")
{
REQUIRE(result);
}
TEST_CASE("zh-TW CPU test", "[zh-TW][cpu]")
{
REQUIRE(result);
}
TEST_CASE("zh-TW verification test", "[zh-TW][ModelVerification]")
{
REQUIRE(result);
}
What I'd like to make happen is to run just the zh-HK and zh-TW ModelVerification tests.
But from my reading of the docs, this doesn't seem to be possible.
If I say [zh-HK],[zh-TW] [ModelVerification], Catch2 will run all the zh-HK tests, all the zh-TW tests, and all the ModelVerification tests.
How can I make this happen?

Related

Firestore Call is freezing my app temporarily - Xcode/iOS/Firestore

I am making a call in my SwiftUI app which will add a document to my Cloud Firestore database. The issue is this is taking around 5 seconds to complete and rendering the app useless for those 5 seconds. I think this could also be down to the cloud functions running when the document is added however I am not sure.
I have tried, rather unsuccessfully so far I might add, to look at using other threads however this is to no avail. Can anyone provide some advice?
This is how I am calling the function:
Button(action: {
DispatchQueue.main.async{
addCard(time: "", text: "\(userSettings.username) Recorded")
}
}){
Text("Another One")
}
This is the actual function that is running.
func addCard(_ card: Card) {
do {
_ = try store.collection(path).addDocument(from: card)
} catch {
fatalError("Unable to add card: \(error.localizedDescription).")
}
}
As I think it could also be my Cloud Functions causing an issue, here it is too:
exports.logActivities = functions.firestore.document('/{collection}/{id}')
.onCreate((snap, context) => {
return admin.messaging().send({
"notification": {
"title": 'New Record',
"body": snap.data()['text'] + ' a new "Tell Em Lad"'
},
"apns": {
"payload": {
"aps": {
"sound": 'notiSound.wav'
}
}
},
"topic": 'client'
});
})
Any help would be greatly appreciated!

Unexpected blocking behavior

I have a Java web app with a HTTP GET method with this code (inside a servlet):
Certificate certificate = Observable.range(1, 10)
.delay(3, TimeUnit.SECONDS)
.filter(integer -> {
try {
LOG.info("AUTHORIZE ATTEMPTS: " + integer);
order.update();
} catch (AcmeException e) {
Exceptions.propagate(e);
}
return order.getStatus() == Status.VALID;
}).map(integer -> {
Certificate cert = order.getCertificate();
return cert;
}).toBlocking().first();
The problem with this in relation to NGINX Unit is that when running in localhost using Jetty maven plugin, nothing is wrong, however when running with NGINX Unit with this application config:
{
"applications": {
"backend": {
"processes": 1,
"type": "java",
"options": [
"-Dlog_path=/var/log/backend-server-0-SNAPSHOT.log"
],
"webapp": "/var/www/backend-server-0-SNAPSHOT.war"
}
},
"listeners": {
"*:8080": {
"application": "backend"
}
}
}
The Java code above blocks the whole web application, meaning, no other HTTP request can be handled by the Java web app for a duration of 30 seconds, since, Observable.range(1, 10) with 3 seconds delay.
I wonder why NGINX Unit is behaving this way. The expected behavior is that the web application should still be able to serve requests.

Dialogflow simulator not responding

I am testing a simple conversation from my dialogflow simulator using a fulfillment hosted in firebase functions.
And I am receiving the fulfillment response when triggered
But my simulator is showing this. Saying no response is received.
Please help
The complete RAW fulfillment response
{
"responseId": "99b660de-e2ca-4d8c-ace5-ef724fe5ee72",
"queryResult": {
"queryText": "male",
"parameters": {
"gender": "male"
},
"allRequiredParamsPresent": true,
"webhookPayload": {
"google": {
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "Amazing"
}
}
]
},
"expectUserResponse": true,
"userStorage": "{\"data\":{}}"
}
},
"outputContexts": [
{
"name": "projects/assurance-purple/agent/sessions/bf891cbe-8642-eb61-ed7b-d6796adfab60/contexts/_actions_on_google",
"lifespanCount": 99,
"parameters": {
"data": "{}",
"gender.original": "male",
"gender": "male"
}
}
],
"intent": {
"name": "projects/assurance-purple/agent/intents/96b523a0-7a3a-4135-bdfc-d9d8ad16b661",
"displayName": "getGender"
},
"intentDetectionConfidence": 1,
"diagnosticInfo": {
"webhook_latency_ms": 45
},
"languageCode": "en"
},
"webhookStatus": {
"message": "Webhook execution successful"
}
}
My actions on google Testing debug tab
`
{
"response": "We're sorry, but something went wrong. Please try again.",
"expectUserResponse": false,
"conversationToken": "",
"audioResponse": "",
"visualResponse": {
"visualElementsList": [
{
"displayText": {
"content": "Sorry, this action is not available in simulation"
}
}
],
"suggestionsList": [],
"agentLogoUrl": ""
},
"clientError": 4,
"is3pResponse": false
}
`
You don't show the entire response (copying and pasting it as text in your question would have been better), but it looks like you're sending a response back for an Action, but trying to test it in Dialogflow's conversation tool.
The Actions on Google response is slightly different than the response that Dialogflow expects to handle the additional features that the Assistant supports. Because of this, you need to use the Actions on Google simulator when testing your agent.
The Dialogflow test is looking for some specific fields to show the response that are not included with the actions-on-google library, and it will not show anything that is in a Google RichResponse object.
To summarize:
If you are working with an Action, use the Actions on Google simulator.
If you are working with other Dialogflow integrations, you can use the test tool on the right in Dialogflow.
Update
The error you're indicating from the AoG Simulator suggests that you're trying to just issue a statement in the conversation and not starting the Action, or that the Action has quit. Make sure you're talking to the action by starting it with "talk to my test app" or whatever the name of your Action is.

Pass Alexa Skill slot name to a new intent on emit

When triggering one intent from another, such as
'LaunchRequest': function () {
this.emit('MyCustomIntent')
}
The request object passed to MyCustomIntent is
"request": {
type: 'LaunchRequest',
requestId: '...',
timestamp: '...',
locale: 'en-US'
}
Notice that no intent nor slot information is passed to MyCustomIntent.
However, every MyCustomIntent request that is sent by the Alexa will include
"request": {
"type": "IntentRequest",
...,
"intent": {
"name": "MyCustomIntent",
"slots": {
"MyCustomSlot": {
"name": "MyCustomSlot"
}
}
}
}
This creates a schism in the development process. When attempting to use MyCustomSlot within MyCustomIntent, if intent, intent.slots, and each respective intent.slots.MyCustomSlotdoes not exist, I will then have to use some default value to allow my code to function properly.
This means it will now be necessary for me to maintain my intent schema in both my Interaction Model, and within my Lambda Function. That sounds very messy, and could get out hand quickly when multiple slots and intents are introduced.
My Question
Is there any way to send the default slot values into the emit, so that I know, without a doubt, that I can always guarantee the same basic request object within MyCustomIntent?
You can use session attribute to pass slot values like
'firstIntent': function() {
this.attributes['slot_value1']= value;
alexa.emit('secondIntent');
}

How to wait for the user to be logged in, in Velocity integration tests

In order to perform my integration tests, the callback from the Meteor.loginWithPassword(... has to have been executed.
If I postpone the test until the user exists, or some Session variable is defined, the tests are ignored.
This is my login function:
Meteor.loginWithPassword(username, forge.util.encode64(aesKey), function(error) {
if(!error) {
Log.info("user loged in");
Session.set("loggedIn", true);
...
})
and then in the Mocha test:
Meteor.startup(function () {
Tracker.autorun(function (c) {
if (Session.get("loggedIn")) {
c.stop();
MochaWeb.testOnly(function () {
Log.info("executing tests");
describe("the KeyPair has been created", function () {
...
My question is: is there a way to make mocha wait for some state or do I have to mock the environment (which would defeat the integration test purpose)?
Also, on code changes, I get following error:
stream error Network error: ws://localhost:51366/websocket: connect ECONNREFUSED
thank you for your support
The feature request that #stubailo pointed out has now been implemented. See https://github.com/meteor/meteor/issues/3572 for more details.

Resources